@trionesdev/antd-mobile-base-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.
Files changed (226) hide show
  1. package/dist/Alert/alert.js +1 -1
  2. package/dist/Alert/style.scss +17 -17
  3. package/dist/Avatar/avatar.d.ts +4 -1
  4. package/dist/Avatar/avatar.js +19 -6
  5. package/dist/Avatar/style.scss +3 -2
  6. package/dist/Card/style.scss +12 -12
  7. package/dist/CascaderView/cascader-column-item.js +1 -1
  8. package/dist/CascaderView/style.scss +2 -2
  9. package/dist/Cell/CellGroup.js +53 -14
  10. package/dist/Cell/cell.js +52 -15
  11. package/dist/Cell/context.d.ts +19 -0
  12. package/dist/Cell/context.js +2 -0
  13. package/dist/Cell/styles.scss +42 -13
  14. package/dist/Cell/types.d.ts +30 -7
  15. package/dist/Checkbox/checkbox-button.d.ts +6 -2
  16. package/dist/Checkbox/checkbox-button.js +6 -18
  17. package/dist/Checkbox/checkbox-group.js +19 -4
  18. package/dist/Checkbox/checkbox-round.d.ts +8 -0
  19. package/dist/Checkbox/checkbox-round.js +35 -0
  20. package/dist/Checkbox/checkbox.js +49 -34
  21. package/dist/Checkbox/index.d.ts +0 -2
  22. package/dist/Checkbox/index.js +0 -2
  23. package/dist/Checkbox/index.scss +48 -34
  24. package/dist/Checkbox/types.d.ts +11 -1
  25. package/dist/ConfigProvider/config-provider.d.ts +1 -0
  26. package/dist/Descriptions/style.scss +4 -4
  27. package/dist/Divider/divider.d.ts +1 -1
  28. package/dist/Divider/divider.js +5 -3
  29. package/dist/Divider/style.scss +7 -7
  30. package/dist/Form/ErrorList.d.ts +4 -0
  31. package/dist/Form/ErrorList.js +9 -0
  32. package/dist/Form/context.d.ts +5 -2
  33. package/dist/Form/context.js +2 -1
  34. package/dist/Form/form.d.ts +25 -12
  35. package/dist/Form/form.js +25 -13
  36. package/dist/Form/hooks/useForm.js +1 -8
  37. package/dist/Form/hooks/useFormContext.js +1 -2
  38. package/dist/Form/index.d.ts +8 -3
  39. package/dist/Form/index.js +7 -2
  40. package/dist/Form/styles.scss +11 -0
  41. package/dist/Form/types.d.ts +8 -0
  42. package/dist/FormCell/FormCell.d.ts +22 -0
  43. package/dist/FormCell/FormCell.js +57 -0
  44. package/dist/FormCell/index.d.ts +4 -0
  45. package/dist/FormCell/index.js +3 -0
  46. package/dist/FormCell/styles.scss +103 -0
  47. package/dist/IndexedStack/IndexedStack.d.ts +9 -0
  48. package/dist/IndexedStack/IndexedStack.js +27 -0
  49. package/dist/IndexedStack/index.d.ts +3 -0
  50. package/dist/IndexedStack/index.js +2 -0
  51. package/dist/InputNumber/input-number.d.ts +3 -2
  52. package/dist/InputNumber/input-number.js +48 -26
  53. package/dist/InputNumber/style.scss +79 -22
  54. package/dist/Loading/DotLoading.d.ts +7 -0
  55. package/dist/{Mask/mask-modal.js → Loading/DotLoading.js} +25 -25
  56. package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -1
  57. package/dist/Loading/SpinLoading.js +69 -0
  58. package/dist/Loading/index.d.ts +6 -0
  59. package/dist/Loading/index.js +4 -0
  60. package/dist/Loading/style.scss +113 -0
  61. package/dist/NavBar/nav-bar.d.ts +1 -0
  62. package/dist/NavBar/nav-bar.js +3 -2
  63. package/dist/NavBar/style.scss +7 -3
  64. package/dist/Progress/Progress.d.ts +39 -0
  65. package/dist/Progress/Progress.js +56 -0
  66. package/dist/Progress/ProgressCircle.d.ts +15 -0
  67. package/dist/Progress/ProgressCircle.js +117 -0
  68. package/dist/Progress/ProgressLine.d.ts +15 -0
  69. package/dist/Progress/ProgressLine.js +87 -0
  70. package/dist/Progress/index.d.ts +3 -0
  71. package/dist/Progress/index.js +2 -0
  72. package/dist/Progress/style.scss +33 -0
  73. package/dist/Progress/types.d.ts +6 -0
  74. package/dist/Progress/types.js +2 -0
  75. package/dist/Radio/RadioGroup.js +3 -3
  76. package/dist/Radio/radio.js +1 -1
  77. package/dist/Radio/style.scss +40 -24
  78. package/dist/Radio/types.d.ts +6 -4
  79. package/dist/Rate/rate.js +1 -1
  80. package/dist/Result/use-result-icon.js +1 -1
  81. package/dist/SafeArea/style.scss +5 -3
  82. package/dist/Scaffold/style.scss +2 -1
  83. package/dist/Segmented/Segmented.d.ts +57 -0
  84. package/dist/Segmented/Segmented.js +82 -0
  85. package/dist/Segmented/index.d.ts +2 -0
  86. package/dist/Segmented/index.js +1 -0
  87. package/dist/Segmented/style.scss +75 -0
  88. package/dist/Skeleton/Skeleton.d.ts +86 -0
  89. package/dist/Skeleton/Skeleton.js +263 -0
  90. package/dist/Skeleton/index.d.ts +3 -0
  91. package/dist/Skeleton/index.js +2 -0
  92. package/dist/Skeleton/style.scss +215 -0
  93. package/dist/Space/space.d.ts +1 -0
  94. package/dist/Space/space.js +20 -6
  95. package/dist/Space/style.scss +27 -3
  96. package/dist/Stepper/index.d.ts +3 -0
  97. package/dist/Stepper/index.js +2 -0
  98. package/dist/Stepper/stepper.d.ts +14 -0
  99. package/dist/Stepper/stepper.js +92 -0
  100. package/dist/Stepper/style.scss +100 -0
  101. package/dist/Steps/HorizontalSteps.js +10 -3
  102. package/dist/Steps/VerticalSteps.js +5 -2
  103. package/dist/Steps/style.scss +7 -0
  104. package/dist/Steps/types.d.ts +2 -0
  105. package/dist/Switch/style.scss +6 -7
  106. package/dist/Switch/switch.d.ts +2 -0
  107. package/dist/Switch/switch.js +6 -5
  108. package/dist/TabBar/index.js +2 -1
  109. package/dist/TabBar/index.scss +3 -2
  110. package/dist/Tabs/style.scss +5 -5
  111. package/dist/Tag/style.scss +45 -21
  112. package/dist/Tag/tag.d.ts +4 -1
  113. package/dist/Tag/tag.js +8 -2
  114. package/dist/index.d.ts +17 -26
  115. package/dist/index.js +8 -13
  116. package/dist/style/css-variable.scss +6 -0
  117. package/dist/style/style.scss +2 -2
  118. package/dist/style/variable.scss +176 -164
  119. package/dist/types.d.ts +10 -1
  120. package/package.json +5 -8
  121. package/dist/ActionSheet/ActionSheet.d.ts +0 -25
  122. package/dist/ActionSheet/ActionSheet.js +0 -77
  123. package/dist/ActionSheet/index.d.ts +0 -3
  124. package/dist/ActionSheet/index.js +0 -2
  125. package/dist/ActionSheet/style.scss +0 -51
  126. package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
  127. package/dist/CascaderPicker/cascader-picker.js +0 -88
  128. package/dist/CascaderPicker/index.d.ts +0 -3
  129. package/dist/CascaderPicker/index.js +0 -2
  130. package/dist/CascaderPicker/style.scss +0 -42
  131. package/dist/Form/FormItem/form-item-input.d.ts +0 -15
  132. package/dist/Form/FormItem/form-item-input.js +0 -39
  133. package/dist/Form/FormItem/form-item-label.d.ts +0 -13
  134. package/dist/Form/FormItem/form-item-label.js +0 -25
  135. package/dist/Form/FormItem/form-item.d.ts +0 -21
  136. package/dist/Form/FormItem/form-item.js +0 -70
  137. package/dist/Form/FormItem/index.d.ts +0 -5
  138. package/dist/Form/FormItem/index.js +0 -3
  139. package/dist/Form/style.scss +0 -45
  140. package/dist/Input/base-input.d.ts +0 -14
  141. package/dist/Input/base-input.js +0 -63
  142. package/dist/Input/index.d.ts +0 -12
  143. package/dist/Input/index.js +0 -9
  144. package/dist/Input/index.scss +0 -173
  145. package/dist/Input/input-affix-wrapper.d.ts +0 -8
  146. package/dist/Input/input-affix-wrapper.js +0 -50
  147. package/dist/Input/input-opt.d.ts +0 -16
  148. package/dist/Input/input-opt.js +0 -93
  149. package/dist/Input/input-password.d.ts +0 -7
  150. package/dist/Input/input-password.js +0 -47
  151. package/dist/Input/input.d.ts +0 -15
  152. package/dist/Input/input.js +0 -47
  153. package/dist/Input/textarea.d.ts +0 -13
  154. package/dist/Input/textarea.js +0 -45
  155. package/dist/Input/types.d.ts +0 -1
  156. package/dist/Input/types.js +0 -1
  157. package/dist/Mask/index.d.ts +0 -3
  158. package/dist/Mask/index.js +0 -2
  159. package/dist/Mask/mask-modal.d.ts +0 -45
  160. package/dist/Mask/mask.d.ts +0 -5
  161. package/dist/Mask/mask.js +0 -19
  162. package/dist/Mask/style.scss +0 -20
  163. package/dist/Picker/index.d.ts +0 -3
  164. package/dist/Picker/index.js +0 -2
  165. package/dist/Picker/picker.d.ts +0 -19
  166. package/dist/Picker/picker.js +0 -97
  167. package/dist/Picker/style.scss +0 -41
  168. package/dist/PickerView/index.d.ts +0 -4
  169. package/dist/PickerView/index.js +0 -2
  170. package/dist/PickerView/picker-view-column-item.d.ts +0 -7
  171. package/dist/PickerView/picker-view-column-item.js +0 -11
  172. package/dist/PickerView/picker-view-column.d.ts +0 -10
  173. package/dist/PickerView/picker-view-column.js +0 -117
  174. package/dist/PickerView/picker-view.d.ts +0 -12
  175. package/dist/PickerView/picker-view.js +0 -60
  176. package/dist/PickerView/style.scss +0 -72
  177. package/dist/PickerView/types.d.ts +0 -4
  178. package/dist/Popup/index.d.ts +0 -3
  179. package/dist/Popup/index.js +0 -2
  180. package/dist/Popup/popup-modal.d.ts +0 -52
  181. package/dist/Popup/popup-modal.js +0 -74
  182. package/dist/Popup/popup.d.ts +0 -4
  183. package/dist/Popup/popup.js +0 -56
  184. package/dist/Popup/style.scss +0 -53
  185. package/dist/ScrollView/index.d.ts +0 -4
  186. package/dist/ScrollView/index.js +0 -2
  187. package/dist/ScrollView/scroll-view.d.ts +0 -4
  188. package/dist/ScrollView/scroll-view.js +0 -55
  189. package/dist/ScrollView/style.scss +0 -19
  190. package/dist/ScrollView/types.d.ts +0 -26
  191. package/dist/ScrollView/types.js +0 -1
  192. package/dist/SideBar/SideBarContext.d.ts +0 -18
  193. package/dist/SideBar/SideBarContext.js +0 -2
  194. package/dist/SideBar/index.d.ts +0 -3
  195. package/dist/SideBar/index.js +0 -2
  196. package/dist/SideBar/side-bar.d.ts +0 -25
  197. package/dist/SideBar/side-bar.js +0 -351
  198. package/dist/SideBar/style.scss +0 -85
  199. package/dist/SideBar/types.d.ts +0 -7
  200. package/dist/SideBar/types.js +0 -1
  201. package/dist/SpinLoading/demo/base.d.ts +0 -3
  202. package/dist/SpinLoading/demo/base.js +0 -21
  203. package/dist/SpinLoading/index.d.ts +0 -3
  204. package/dist/SpinLoading/index.js +0 -2
  205. package/dist/SpinLoading/spin-loading.js +0 -59
  206. package/dist/SpinLoading/spin-loading.scss +0 -40
  207. package/dist/Tabs/demo/base.d.ts +0 -3
  208. package/dist/Tabs/demo/base.js +0 -59
  209. package/dist/Tag/demo/base.d.ts +0 -7
  210. package/dist/Tag/demo/base.js +0 -67
  211. package/dist/Tag/demo/style.scss +0 -8
  212. package/dist/Toast/index.d.ts +0 -5
  213. package/dist/Toast/index.js +0 -3
  214. package/dist/Toast/style.scss +0 -63
  215. package/dist/Toast/toast-modal.d.ts +0 -18
  216. package/dist/Toast/toast-modal.js +0 -112
  217. package/dist/Toast/toast.d.ts +0 -7
  218. package/dist/Toast/toast.js +0 -78
  219. package/dist/VerificationCodeInput/demo/base.d.ts +0 -3
  220. package/dist/VerificationCodeInput/demo/base.js +0 -11
  221. package/dist/VerificationCodeInput/index.d.ts +0 -3
  222. package/dist/VerificationCodeInput/index.js +0 -2
  223. package/dist/VerificationCodeInput/style.scss +0 -20
  224. package/dist/VerificationCodeInput/verification-code-input.d.ts +0 -24
  225. package/dist/VerificationCodeInput/verification-code-input.js +0 -99
  226. /package/dist/{PickerView → Form}/types.js +0 -0
@@ -1,43 +1,100 @@
1
- @use "../style/variable" as *;
1
+ @use "../style/variable" as variable;
2
+
2
3
  $trionesInputNumberCls: 'triones-antm-input-number';
3
4
 
5
+ $inputNumberBg: #F5F5F5;
6
+ $inputSm: 24Px;
7
+ $inputLg: 40Px;
8
+ $inputNumberControlHeight: 28Px;
9
+
4
10
  .#{$trionesInputNumberCls} {
5
11
  display: inline-flex;
6
- align-items: center;
7
- gap: 4Px;
8
- border-radius: $trionesBorderRadius;
9
- background-color: $trionesColorTextQuaternary;
10
-
11
- input {
12
- &::-webkit-outer-spin-button,
13
- &::-webkit-inner-spin-button {
14
- -webkit-appearance: none;
15
- margin: 0;
12
+ align-items: stretch;
13
+ gap: 2Px;
14
+ border-radius: variable.$trionesBorderRadiusXs;
15
+ overflow: hidden;
16
+
17
+ &--block {
18
+ display: flex;
19
+ width: 100%;
20
+
21
+ .#{$trionesInputNumberCls}-input {
22
+ flex: 1 1 auto;
23
+ min-width: 0;
16
24
  }
25
+ }
26
+
27
+ &-input {
28
+ display: flex;
29
+ align-items: stretch;
30
+ flex: 0 1 auto;
31
+ min-width: 36Px;
32
+ min-height: $inputNumberControlHeight;
17
33
 
18
- border: 0;
19
- text-align: center;
20
- width: 30Px;
34
+ input {
35
+ width: 100%;
36
+ min-width: 0;
37
+ height: 100%;
38
+ min-height: $inputNumberControlHeight;
39
+ box-sizing: border-box;
40
+ margin: 0;
41
+ padding: 0 8Px;
42
+ border: 0;
43
+ border-radius: variable.$trionesBorderRadiusXs;
44
+ background-color: $inputNumberBg;
45
+ color: variable.$trionesColorText;
46
+ font-size: 14Px;
47
+ line-height: $inputNumberControlHeight;
48
+ text-align: center;
49
+ -moz-appearance: textfield;
50
+ appearance: textfield;
51
+
52
+ &::-webkit-outer-spin-button,
53
+ &::-webkit-inner-spin-button {
54
+ -webkit-appearance: none;
55
+ margin: 0;
56
+ }
57
+
58
+ &:focus {
59
+ outline: none;
60
+ }
21
61
 
22
- &:focus {
23
- outline: none;
62
+ &:disabled {
63
+ color: variable.$trionesColorTextDisabled;
64
+ cursor: not-allowed;
65
+ }
24
66
  }
25
67
  }
26
68
 
27
69
  &-button {
28
70
  cursor: pointer;
29
71
  display: flex;
72
+ flex-shrink: 0;
30
73
  font-size: 10Px;
31
- height: 20Px;
32
- width: 20Px;
74
+ height: $inputNumberControlHeight;
75
+ width: $inputNumberControlHeight;
33
76
  justify-content: center;
34
77
  align-items: center;
35
- &-disabled{
78
+ background-color: $inputNumberBg;
79
+ border-radius: variable.$trionesBorderRadiusXs;
80
+
81
+ &-sm {
82
+ width: $inputSm;
83
+ height: $inputSm;
84
+ }
85
+
86
+ &-lg {
87
+ width: $inputLg;
88
+ height: $inputLg;
89
+ }
90
+
91
+ &-disabled {
36
92
  cursor: not-allowed;
37
- color: $trionesColorTextDisabled;
93
+ color: variable.$trionesColorTextDisabled;
38
94
  }
39
- .triones-antm-icon{
40
- font-size: 10Px!important;
95
+
96
+ .triones-antm-icon {
97
+ font-size: 10Px !important;
41
98
  }
42
99
  }
43
100
  }
@@ -0,0 +1,7 @@
1
+ import React, { FC } from 'react';
2
+ export type DotLoadingProps = {
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ color?: 'default' | 'primary' | 'white' | string;
6
+ };
7
+ export declare const DotLoading: FC<DotLoadingProps>;
@@ -4,29 +4,29 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import React from "react";
8
- import classNames from "classnames";
9
- var maskCls = "triones-antm-mask2";
10
- export var MaskModal = function MaskModal(_ref) {
11
- var children = _ref.children,
12
- className = _ref.className,
13
- style = _ref.style,
14
- zIndex = _ref.zIndex,
15
- open = _ref.open,
16
- _ref$maskClosable = _ref.maskClosable,
17
- maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
18
- onMaskClick = _ref.onMaskClick;
19
- return /*#__PURE__*/React.createElement("div", {
20
- className: classNames(maskCls, _defineProperty({}, "".concat(maskCls, "-open"), open)),
21
- style: _objectSpread(_objectSpread({}, style), {}, {
22
- zIndex: zIndex
23
- }),
24
- onClick: function onClick(e) {
25
- if (maskClosable) {
26
- onMaskClick === null || onMaskClick === void 0 || onMaskClick(e);
27
- }
7
+ import classNames from 'classnames';
8
+ import React, { memo, useMemo } from 'react';
9
+ var dotLoadingCls = 'triones-antm-dot-loading';
10
+ export var DotLoading = /*#__PURE__*/memo(function (_ref) {
11
+ var className = _ref.className,
12
+ styleProp = _ref.style,
13
+ _ref$color = _ref.color,
14
+ colorProp = _ref$color === void 0 ? 'default' : _ref$color;
15
+ var colors = ['default', 'primary', 'white'];
16
+ var rootStyle = useMemo(function () {
17
+ var style = _objectSpread({}, styleProp);
18
+ if (!colors.includes(colorProp)) {
19
+ style.color = colorProp;
28
20
  }
29
- }, /*#__PURE__*/React.createElement("div", {
30
- className: classNames("".concat(maskCls, "-inner"), className)
31
- }, children));
32
- };
21
+ return style;
22
+ }, [colorProp]);
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: classNames(className, dotLoadingCls, _defineProperty({}, "".concat(dotLoadingCls, "-").concat(colorProp), colors.includes(colorProp))),
25
+ style: rootStyle
26
+ }, [0, 1, 2].map(function (i) {
27
+ return /*#__PURE__*/React.createElement("i", {
28
+ key: i,
29
+ className: classNames("".concat(dotLoadingCls, "-dot"), "".concat(dotLoadingCls, "-dot-").concat(i))
30
+ });
31
+ }));
32
+ });
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
- import './spin-loading.scss';
3
2
  export type SpinLoadingProps = {
4
3
  size?: 'small' | 'middle' | 'large' | number;
5
4
  color?: 'default' | 'primary' | 'white' | string;
@@ -0,0 +1,69 @@
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
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import classNames from 'classnames';
6
+ import Base64 from 'crypto-js/enc-base64';
7
+ import Utf8 from 'crypto-js/enc-utf8';
8
+ import React from 'react';
9
+ var spinLoadingCls = 'triones-antm-spin-loading';
10
+ export function createSvgStr(props) {
11
+ return "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"width:100%;height:100%\" viewBox=\"0 0 32 32\">\n <circle r=\"15\" cx=\"16\" cy=\"16\"\n stroke-width=\"2\"\n stroke=\"".concat(props.stroke, "\"\n fill=\"transparent\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"").concat(15 * 3.14159265358979 * 2, "\"\n stroke-dashoffset=\"").concat(15 * 3.14159265358979 * 0.5, "\"></circle>\n </svg>");
12
+ }
13
+ export var SpinLoading = function SpinLoading(_ref) {
14
+ var _ref$size = _ref.size,
15
+ size = _ref$size === void 0 ? 'middle' : _ref$size,
16
+ _ref$color = _ref.color,
17
+ colorProp = _ref$color === void 0 ? 'default' : _ref$color;
18
+ var colors = ['default', 'primary', 'white'];
19
+ var computedSize = React.useMemo(function () {
20
+ var resSize = null;
21
+ if (size === 'small') {
22
+ resSize = '24Px';
23
+ } else if (size === 'middle') {
24
+ resSize = '32Px';
25
+ } else if (size === 'large') {
26
+ resSize = '48Px';
27
+ } else {
28
+ resSize = size;
29
+ }
30
+ if (typeof resSize === 'number') {
31
+ return "".concat(resSize, "Px");
32
+ } else {
33
+ return resSize;
34
+ }
35
+ }, [size]);
36
+
37
+ // const computedColor = React.useMemo(() => {
38
+ // if (colorProp === 'default') {
39
+ // return '#9D9D9D';
40
+ // } else if (colorProp === 'primary') {
41
+ // return '#1677ff';
42
+ // } else if (colorProp === 'white') {
43
+ // return '#ffffff';
44
+ // } else {
45
+ // return colorProp;
46
+ // }
47
+ // }, [colorProp]);
48
+
49
+ var completedStyle = React.useMemo(function () {
50
+ var maskImageSvg = createSvgStr({
51
+ stroke: 'currentColor'
52
+ });
53
+ var style = {
54
+ '--size': computedSize,
55
+ // '--color': computedColor,
56
+ '--maskImage': "url(data:image/svg+xml;base64,".concat(Base64.stringify(Utf8.parse(maskImageSvg)), ")")
57
+ };
58
+ if (!colors.includes(colorProp)) {
59
+ style.color = colorProp;
60
+ }
61
+ return style;
62
+ }, [computedSize, colorProp]);
63
+ return /*#__PURE__*/React.createElement("div", {
64
+ className: classNames(spinLoadingCls, _defineProperty({}, "".concat(spinLoadingCls, "-").concat(colorProp), colors.includes(colorProp))),
65
+ style: completedStyle
66
+ }, /*#__PURE__*/React.createElement("i", {
67
+ className: classNames("".concat(spinLoadingCls, "-spin"))
68
+ }));
69
+ };
@@ -0,0 +1,6 @@
1
+ import { SpinLoading, SpinLoadingProps } from './SpinLoading';
2
+ import "./style.scss";
3
+ export { DotLoading } from './DotLoading';
4
+ export type { DotLoadingProps } from './DotLoading';
5
+ export type { SpinLoadingProps };
6
+ export { SpinLoading };
@@ -0,0 +1,4 @@
1
+ import { SpinLoading } from "./SpinLoading";
2
+ import "./style.scss";
3
+ export { DotLoading } from "./DotLoading";
4
+ export { SpinLoading };
@@ -0,0 +1,113 @@
1
+ @use "../style/variable";
2
+
3
+ $dotLoadingCls: triones-antm-dot-loading;
4
+ $spinLoadingCls: triones-antm-spin-loading;
5
+
6
+ .#{$dotLoadingCls} {
7
+ display: inline-flex;
8
+ align-items: center;
9
+ height: 1em;
10
+ vertical-align: -0.125em;
11
+ /* 18 / 40 * 1em — horizontal gap between dots in antd-mobile viewBox */
12
+ gap: 0.45em;
13
+
14
+ &-default {
15
+ color: #9D9D9D;
16
+ }
17
+
18
+ &-primary {
19
+ color: variable.$trionesColorPrimary;
20
+ }
21
+
22
+ &-white {
23
+ color: white;
24
+ }
25
+
26
+ &-dot {
27
+ display: block;
28
+ flex-shrink: 0;
29
+ /* 8×8 in a 40-unit-tall viewBox, height = 1em */
30
+ width: 0.2em;
31
+ height: 0.2em;
32
+ background: currentColor;
33
+ //mask-image: var(--dotLoadingMask);
34
+ //-webkit-mask-image: var(--dotLoadingMask);
35
+ mask-repeat: no-repeat;
36
+ -webkit-mask-repeat: no-repeat;
37
+ mask-size: 100% 100%;
38
+ -webkit-mask-size: 100% 100%;
39
+ mask-position: center;
40
+ -webkit-mask-position: center;
41
+ animation: triones-antm-dot-loading-bounce 2s infinite linear;
42
+ animation-fill-mode: backwards;
43
+ }
44
+
45
+ &-dot-0 {
46
+ animation-delay: 0s;
47
+ }
48
+
49
+ &-dot-1 {
50
+ animation-delay: 0.2s;
51
+ }
52
+
53
+ &-dot-2 {
54
+ animation-delay: 0.4s;
55
+ }
56
+ }
57
+
58
+ /* Mirrors antd-mobile SMIL: values 16;6;26;16;16, keyTimes 0;0.1;0.3;0.4;1, viewBox height 40 */
59
+ @keyframes triones-antm-dot-loading-bounce {
60
+ 0%,
61
+ 40%,
62
+ 100% {
63
+ transform: translateY(0);
64
+ }
65
+
66
+ 10% {
67
+ transform: translateY(-0.25em);
68
+ }
69
+
70
+ 30% {
71
+ transform: translateY(0.25em);
72
+ }
73
+ }
74
+
75
+
76
+
77
+
78
+ .#{$spinLoadingCls} {
79
+ --size: 32Px;
80
+ width: var(--size);
81
+ height: var(--size);
82
+
83
+ &-default{
84
+ color: #9D9D9D;
85
+ }
86
+ &-primary{
87
+ color: variable.$trionesColorPrimary;
88
+ }
89
+ &-white{
90
+ color: #ffffff;
91
+ }
92
+
93
+ &-spin {
94
+ //color: var(--color);
95
+ display: inline-block;
96
+ height: 100%;
97
+ width: 100%;
98
+ background: currentColor;
99
+ mask-image: var(--maskImage);
100
+ -webkit-mask-image: var(--maskImage);
101
+ animation: adm-spin-loading-rotate 2s infinite linear;
102
+ }
103
+
104
+ }
105
+
106
+ @keyframes adm-spin-loading-rotate {
107
+ from {
108
+ transform: rotate(0deg);
109
+ }
110
+ to {
111
+ transform: rotate(360deg);
112
+ }
113
+ }
@@ -26,6 +26,7 @@ export type NavBarProps = {
26
26
  * @description 标题
27
27
  */
28
28
  children?: ReactNode;
29
+ className?: string;
29
30
  style?: CSSProperties;
30
31
  };
31
32
  export declare const NavBar: FC<NavBarProps>;
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { withNativeProps } from "../utils/native-props";
4
4
  import ConfigProvider from "../ConfigProvider";
5
5
  import { mergeProp, mergeProps } from "../utils/with-default-props";
6
- import { LeftOutline } from "../../../antd-mobile-icons-react";
6
+ import { LeftOutline } from '@trionesdev/antd-mobile-icons-react';
7
7
  import "./style.scss";
8
8
  var classPrefix = "triones-antm-nav-bar";
9
9
  var defaultBackIcon = /*#__PURE__*/React.createElement(LeftOutline, null);
@@ -17,7 +17,8 @@ export var NavBar = function NavBar(props) {
17
17
  var mergedDefaultBackIcon = componentConfig.backIcon || defaultBackIcon;
18
18
  var mergedBackIcon = mergeProp(defaultBackIcon, componentConfig.backIcon, backIcon === true ? mergedDefaultBackIcon : backIcon);
19
19
  return withNativeProps(mergedProps, /*#__PURE__*/React.createElement("div", {
20
- className: classNames(classPrefix)
20
+ className: classNames(classPrefix, mergedProps.className),
21
+ style: mergedProps.style
21
22
  }, /*#__PURE__*/React.createElement("div", {
22
23
  className: "".concat(classPrefix, "-left"),
23
24
  role: "button"
@@ -1,6 +1,7 @@
1
- @use "../style/variable" as *;
2
- $trionesNavBarColorBg:$trionesColorBorderBg !default;
3
- $trionesNavBarColorText:$trionesColorTextBase !default;
1
+ @use "../style/variable" as variable;
2
+
3
+ $trionesNavBarColorBg: variable.$trionesColorBorderBg !default;
4
+ $trionesNavBarColorText: variable.$trionesColorTextBase !default;
4
5
 
5
6
  $class-prefix-nav-bar: 'triones-antm-nav-bar';
6
7
  /* prettier-ignore */
@@ -8,6 +9,7 @@ $class-prefix-nav-bar: 'triones-antm-nav-bar';
8
9
  --height: 45PX;
9
10
  --border-bottom: none;
10
11
  display: flex;
12
+ flex: none;
11
13
  align-items: center;
12
14
  height: var(--height);
13
15
  border-bottom: var(--border-bottom);
@@ -20,6 +22,7 @@ $class-prefix-nav-bar: 'triones-antm-nav-bar';
20
22
  &-right {
21
23
  flex: 1;
22
24
  }
25
+
23
26
  &-title {
24
27
  flex: auto;
25
28
  text-align: center;
@@ -33,6 +36,7 @@ $class-prefix-nav-bar: 'triones-antm-nav-bar';
33
36
  margin-right: 16PX;
34
37
  padding: 6PX 0;
35
38
  cursor: pointer;
39
+
36
40
  &-arrow {
37
41
  font-size: 20PX;
38
42
  margin-right: 5PX;
@@ -0,0 +1,39 @@
1
+ import { FC } from "react";
2
+ import { Size } from "./types";
3
+ import "./style.scss";
4
+ import { PercentPositionAlign, ProgressStatus } from "./types";
5
+ import "./style.scss";
6
+ export type ProgressProps = {
7
+ /**
8
+ * @description 内容的模板函数
9
+ * @default percent => `${percent}%`
10
+ */
11
+ format?: (percent: number) => string;
12
+ type?: 'line' | 'circle';
13
+ /**
14
+ * @description 百分比
15
+ * @default 0
16
+ */
17
+ percent?: number;
18
+ size?: Size;
19
+ /**
20
+ * @description 是否显示进度数值或状态图标
21
+ * @default true
22
+ */
23
+ showInfo?: boolean;
24
+ /**
25
+ * @description 未完成的分段的颜色
26
+ */
27
+ railColor?: string;
28
+ /**
29
+ * @description 进度条的色彩
30
+ */
31
+ strokeColor?: string;
32
+ strokeWidth?: number;
33
+ status?: ProgressStatus;
34
+ /**
35
+ * @description 进度数值位置
36
+ */
37
+ percentPositionAlign?: PercentPositionAlign;
38
+ };
39
+ export declare const Progress: FC<ProgressProps>;
@@ -0,0 +1,56 @@
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
+ import "./style.scss";
7
+ export var Progress = function Progress(_ref) {
8
+ var format = _ref.format,
9
+ _ref$type = _ref.type,
10
+ type = _ref$type === void 0 ? 'line' : _ref$type,
11
+ _ref$percent = _ref.percent,
12
+ percent = _ref$percent === void 0 ? 0 : _ref$percent,
13
+ _ref$size = _ref.size,
14
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
15
+ _ref$showInfo = _ref.showInfo,
16
+ showInfo = _ref$showInfo === void 0 ? true : _ref$showInfo,
17
+ _ref$railColor = _ref.railColor,
18
+ railColor = _ref$railColor === void 0 ? '#E5E5E5' : _ref$railColor,
19
+ _ref$strokeColor = _ref.strokeColor,
20
+ strokeColor = _ref$strokeColor === void 0 ? '#1777FF' : _ref$strokeColor,
21
+ _ref$strokeWidth = _ref.strokeWidth,
22
+ strokeWidth = _ref$strokeWidth === void 0 ? 6 : _ref$strokeWidth,
23
+ status = _ref.status,
24
+ percentPositionAlign = _ref.percentPositionAlign;
25
+ var handleComputedStrokeColor = function handleComputedStrokeColor() {
26
+ if (status === 'exception') {
27
+ return exceptionColor;
28
+ }
29
+ if (percent >= 100) {
30
+ return successColor;
31
+ }
32
+ return strokeColor;
33
+ };
34
+ if (type === 'line') {
35
+ return /*#__PURE__*/React.createElement(ProgressLine, {
36
+ format: format,
37
+ percent: percent,
38
+ size: size,
39
+ railColor: railColor,
40
+ strokeColor: handleComputedStrokeColor(),
41
+ status: status,
42
+ showInfo: showInfo,
43
+ percentPositionAlign: percentPositionAlign
44
+ });
45
+ }
46
+ return /*#__PURE__*/React.createElement(ProgressCircle, {
47
+ format: format,
48
+ percent: percent,
49
+ size: size,
50
+ railColor: railColor,
51
+ strokeColor: handleComputedStrokeColor(),
52
+ strokeWidth: strokeWidth,
53
+ showInfo: showInfo,
54
+ status: status
55
+ });
56
+ };
@@ -0,0 +1,15 @@
1
+ import { FC } from "react";
2
+ import { ProgressStatus, Size } from "./types";
3
+ type ProcessCircleProps = {
4
+ format?: (percent: number) => string;
5
+ percent?: number;
6
+ strokeWidth?: number;
7
+ size?: Size;
8
+ showInfo?: boolean;
9
+ railColor?: string;
10
+ strokeColor?: string;
11
+ strokeLineCap?: 'butt' | 'round' | 'square';
12
+ status?: ProgressStatus;
13
+ };
14
+ export declare const ProgressCircle: FC<ProcessCircleProps>;
15
+ export {};