@trionesdev/antd-mobile-base-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 (249) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -23
  3. package/dist/Alert/alert.js +1 -1
  4. package/dist/Alert/style.scss +69 -69
  5. package/dist/Avatar/avatar.d.ts +4 -1
  6. package/dist/Avatar/avatar.js +19 -6
  7. package/dist/Avatar/style.scss +17 -16
  8. package/dist/Badge/style.scss +100 -100
  9. package/dist/Card/style.scss +35 -35
  10. package/dist/CascaderView/cascader-column-item.js +1 -1
  11. package/dist/CascaderView/style.scss +22 -22
  12. package/dist/Cell/CellGroup.js +53 -14
  13. package/dist/Cell/cell.js +52 -15
  14. package/dist/Cell/context.d.ts +19 -0
  15. package/dist/Cell/context.js +2 -0
  16. package/dist/Cell/styles.scss +81 -52
  17. package/dist/Cell/types.d.ts +30 -7
  18. package/dist/Checkbox/checkbox-button.d.ts +6 -2
  19. package/dist/Checkbox/checkbox-button.js +6 -18
  20. package/dist/Checkbox/checkbox-group.js +19 -4
  21. package/dist/Checkbox/checkbox-round.d.ts +8 -0
  22. package/dist/Checkbox/checkbox-round.js +35 -0
  23. package/dist/Checkbox/checkbox.js +49 -34
  24. package/dist/Checkbox/index.d.ts +0 -2
  25. package/dist/Checkbox/index.js +0 -2
  26. package/dist/Checkbox/index.scss +165 -151
  27. package/dist/Checkbox/types.d.ts +11 -1
  28. package/dist/ConfigProvider/config-provider.d.ts +1 -0
  29. package/dist/DemoBlock/index.scss +20 -20
  30. package/dist/DemoDescription/index.scss +3 -3
  31. package/dist/Descriptions/style.scss +65 -65
  32. package/dist/Divider/divider.d.ts +1 -1
  33. package/dist/Divider/divider.js +5 -3
  34. package/dist/Divider/style.scss +62 -62
  35. package/dist/Ellipsis/style.scss +13 -13
  36. package/dist/Empty/style.scss +29 -29
  37. package/dist/ErrorBlock/demo/base.js +2 -2
  38. package/dist/ErrorBlock/style.scss +62 -62
  39. package/dist/Footer/style.scss +55 -55
  40. package/dist/Form/ErrorList.d.ts +4 -0
  41. package/dist/Form/ErrorList.js +9 -0
  42. package/dist/Form/context.d.ts +5 -2
  43. package/dist/Form/context.js +2 -1
  44. package/dist/Form/form.d.ts +25 -12
  45. package/dist/Form/form.js +25 -13
  46. package/dist/Form/hooks/useForm.js +1 -8
  47. package/dist/Form/hooks/useFormContext.js +1 -2
  48. package/dist/Form/index.d.ts +8 -3
  49. package/dist/Form/index.js +7 -2
  50. package/dist/Form/styles.scss +11 -0
  51. package/dist/Form/types.d.ts +8 -0
  52. package/dist/FormCell/FormCell.d.ts +21 -0
  53. package/dist/FormCell/FormCell.js +56 -0
  54. package/dist/FormCell/index.d.ts +4 -0
  55. package/dist/FormCell/index.js +3 -0
  56. package/dist/FormCell/styles.scss +103 -0
  57. package/dist/Grid/style.scss +17 -17
  58. package/dist/Icon/demo/base.js +2 -2
  59. package/dist/IndexedStack/IndexedStack.d.ts +9 -0
  60. package/dist/IndexedStack/IndexedStack.js +27 -0
  61. package/dist/IndexedStack/index.d.ts +3 -0
  62. package/dist/IndexedStack/index.js +2 -0
  63. package/dist/InputNumber/input-number.d.ts +3 -2
  64. package/dist/InputNumber/input-number.js +48 -26
  65. package/dist/InputNumber/style.scss +100 -43
  66. package/dist/Loading/DotLoading.d.ts +7 -0
  67. package/dist/{Mask/mask-modal.js → Loading/DotLoading.js} +25 -25
  68. package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -1
  69. package/dist/Loading/SpinLoading.js +69 -0
  70. package/dist/Loading/index.d.ts +6 -0
  71. package/dist/Loading/index.js +4 -0
  72. package/dist/Loading/style.scss +113 -0
  73. package/dist/NavBar/nav-bar.d.ts +1 -0
  74. package/dist/NavBar/nav-bar.js +3 -2
  75. package/dist/NavBar/style.scss +65 -61
  76. package/dist/NoticeBar/style.scss +130 -130
  77. package/dist/PageIndicator/style.scss +59 -59
  78. package/dist/Progress/Progress.d.ts +39 -0
  79. package/dist/Progress/Progress.js +56 -0
  80. package/dist/Progress/ProgressCircle.d.ts +15 -0
  81. package/dist/Progress/ProgressCircle.js +117 -0
  82. package/dist/Progress/ProgressLine.d.ts +15 -0
  83. package/dist/Progress/ProgressLine.js +87 -0
  84. package/dist/Progress/index.d.ts +3 -0
  85. package/dist/Progress/index.js +2 -0
  86. package/dist/Progress/style.scss +33 -0
  87. package/dist/Progress/types.d.ts +6 -0
  88. package/dist/Progress/types.js +2 -0
  89. package/dist/Radio/RadioGroup.js +3 -3
  90. package/dist/Radio/radio.js +1 -1
  91. package/dist/Radio/style.scss +154 -138
  92. package/dist/Radio/types.d.ts +6 -4
  93. package/dist/Rate/rate.js +1 -1
  94. package/dist/Rate/style.scss +37 -37
  95. package/dist/Result/demo/base.js +2 -2
  96. package/dist/Result/style.scss +73 -73
  97. package/dist/Result/use-result-icon.js +1 -1
  98. package/dist/SafeArea/style.scss +20 -18
  99. package/dist/Scaffold/style.scss +17 -16
  100. package/dist/Segmented/Segmented.d.ts +57 -0
  101. package/dist/Segmented/Segmented.js +82 -0
  102. package/dist/Segmented/index.d.ts +2 -0
  103. package/dist/Segmented/index.js +1 -0
  104. package/dist/Segmented/style.scss +75 -0
  105. package/dist/Skeleton/Skeleton.d.ts +86 -0
  106. package/dist/Skeleton/Skeleton.js +263 -0
  107. package/dist/Skeleton/index.d.ts +3 -0
  108. package/dist/Skeleton/index.js +2 -0
  109. package/dist/Skeleton/style.scss +215 -0
  110. package/dist/Space/space.d.ts +1 -0
  111. package/dist/Space/space.js +20 -6
  112. package/dist/Space/style.scss +101 -77
  113. package/dist/Stepper/index.d.ts +3 -0
  114. package/dist/Stepper/index.js +2 -0
  115. package/dist/Stepper/stepper.d.ts +14 -0
  116. package/dist/Stepper/stepper.js +92 -0
  117. package/dist/Stepper/style.scss +100 -0
  118. package/dist/Steps/HorizontalSteps.js +10 -3
  119. package/dist/Steps/VerticalSteps.js +5 -2
  120. package/dist/Steps/style.scss +153 -146
  121. package/dist/Steps/types.d.ts +2 -0
  122. package/dist/Switch/style.scss +127 -128
  123. package/dist/Switch/switch.d.ts +2 -0
  124. package/dist/Switch/switch.js +6 -5
  125. package/dist/TabBar/demo/base.js +2 -2
  126. package/dist/TabBar/index.js +2 -1
  127. package/dist/TabBar/index.scss +37 -36
  128. package/dist/Tabs/style.scss +108 -108
  129. package/dist/Tag/style.scss +110 -86
  130. package/dist/Tag/tag.d.ts +4 -1
  131. package/dist/Tag/tag.js +8 -2
  132. package/dist/WaterMark/style.scss +17 -17
  133. package/dist/index.d.ts +17 -26
  134. package/dist/index.js +8 -13
  135. package/dist/style/css-variable.scss +6 -0
  136. package/dist/style/style.scss +52 -52
  137. package/dist/style/theme-dark.scss +24 -24
  138. package/dist/style/theme-default.scss +54 -54
  139. package/dist/style/variable.scss +180 -168
  140. package/dist/types.d.ts +10 -1
  141. package/dist/utils/type.js +36 -36
  142. package/dist/utils/with-default-props.js +4 -4
  143. package/package.json +5 -8
  144. package/dist/ActionSheet/ActionSheet.d.ts +0 -25
  145. package/dist/ActionSheet/ActionSheet.js +0 -77
  146. package/dist/ActionSheet/index.d.ts +0 -3
  147. package/dist/ActionSheet/index.js +0 -2
  148. package/dist/ActionSheet/style.scss +0 -51
  149. package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
  150. package/dist/CascaderPicker/cascader-picker.js +0 -88
  151. package/dist/CascaderPicker/index.d.ts +0 -3
  152. package/dist/CascaderPicker/index.js +0 -2
  153. package/dist/CascaderPicker/style.scss +0 -42
  154. package/dist/Form/FormItem/form-item-input.d.ts +0 -15
  155. package/dist/Form/FormItem/form-item-input.js +0 -39
  156. package/dist/Form/FormItem/form-item-label.d.ts +0 -13
  157. package/dist/Form/FormItem/form-item-label.js +0 -25
  158. package/dist/Form/FormItem/form-item.d.ts +0 -21
  159. package/dist/Form/FormItem/form-item.js +0 -70
  160. package/dist/Form/FormItem/index.d.ts +0 -5
  161. package/dist/Form/FormItem/index.js +0 -3
  162. package/dist/Form/style.scss +0 -45
  163. package/dist/Input/base-input.d.ts +0 -14
  164. package/dist/Input/base-input.js +0 -63
  165. package/dist/Input/index.d.ts +0 -12
  166. package/dist/Input/index.js +0 -9
  167. package/dist/Input/index.scss +0 -173
  168. package/dist/Input/input-affix-wrapper.d.ts +0 -8
  169. package/dist/Input/input-affix-wrapper.js +0 -50
  170. package/dist/Input/input-opt.d.ts +0 -16
  171. package/dist/Input/input-opt.js +0 -93
  172. package/dist/Input/input-password.d.ts +0 -7
  173. package/dist/Input/input-password.js +0 -47
  174. package/dist/Input/input.d.ts +0 -15
  175. package/dist/Input/input.js +0 -47
  176. package/dist/Input/textarea.d.ts +0 -13
  177. package/dist/Input/textarea.js +0 -45
  178. package/dist/Input/types.d.ts +0 -1
  179. package/dist/Input/types.js +0 -1
  180. package/dist/Mask/index.d.ts +0 -3
  181. package/dist/Mask/index.js +0 -2
  182. package/dist/Mask/mask-modal.d.ts +0 -45
  183. package/dist/Mask/mask.d.ts +0 -5
  184. package/dist/Mask/mask.js +0 -19
  185. package/dist/Mask/style.scss +0 -20
  186. package/dist/Picker/index.d.ts +0 -3
  187. package/dist/Picker/index.js +0 -2
  188. package/dist/Picker/picker.d.ts +0 -19
  189. package/dist/Picker/picker.js +0 -97
  190. package/dist/Picker/style.scss +0 -41
  191. package/dist/PickerView/index.d.ts +0 -4
  192. package/dist/PickerView/index.js +0 -2
  193. package/dist/PickerView/picker-view-column-item.d.ts +0 -7
  194. package/dist/PickerView/picker-view-column-item.js +0 -11
  195. package/dist/PickerView/picker-view-column.d.ts +0 -10
  196. package/dist/PickerView/picker-view-column.js +0 -117
  197. package/dist/PickerView/picker-view.d.ts +0 -12
  198. package/dist/PickerView/picker-view.js +0 -60
  199. package/dist/PickerView/style.scss +0 -72
  200. package/dist/PickerView/types.d.ts +0 -4
  201. package/dist/Popup/index.d.ts +0 -3
  202. package/dist/Popup/index.js +0 -2
  203. package/dist/Popup/popup-modal.d.ts +0 -52
  204. package/dist/Popup/popup-modal.js +0 -74
  205. package/dist/Popup/popup.d.ts +0 -4
  206. package/dist/Popup/popup.js +0 -56
  207. package/dist/Popup/style.scss +0 -53
  208. package/dist/ScrollView/index.d.ts +0 -4
  209. package/dist/ScrollView/index.js +0 -2
  210. package/dist/ScrollView/scroll-view.d.ts +0 -4
  211. package/dist/ScrollView/scroll-view.js +0 -55
  212. package/dist/ScrollView/style.scss +0 -19
  213. package/dist/ScrollView/types.d.ts +0 -26
  214. package/dist/ScrollView/types.js +0 -1
  215. package/dist/SideBar/SideBarContext.d.ts +0 -18
  216. package/dist/SideBar/SideBarContext.js +0 -2
  217. package/dist/SideBar/index.d.ts +0 -3
  218. package/dist/SideBar/index.js +0 -2
  219. package/dist/SideBar/side-bar.d.ts +0 -25
  220. package/dist/SideBar/side-bar.js +0 -351
  221. package/dist/SideBar/style.scss +0 -85
  222. package/dist/SideBar/types.d.ts +0 -7
  223. package/dist/SideBar/types.js +0 -1
  224. package/dist/SpinLoading/demo/base.d.ts +0 -3
  225. package/dist/SpinLoading/demo/base.js +0 -21
  226. package/dist/SpinLoading/index.d.ts +0 -3
  227. package/dist/SpinLoading/index.js +0 -2
  228. package/dist/SpinLoading/spin-loading.js +0 -59
  229. package/dist/SpinLoading/spin-loading.scss +0 -40
  230. package/dist/Tabs/demo/base.d.ts +0 -3
  231. package/dist/Tabs/demo/base.js +0 -59
  232. package/dist/Tag/demo/base.d.ts +0 -7
  233. package/dist/Tag/demo/base.js +0 -67
  234. package/dist/Tag/demo/style.scss +0 -8
  235. package/dist/Toast/index.d.ts +0 -5
  236. package/dist/Toast/index.js +0 -3
  237. package/dist/Toast/style.scss +0 -63
  238. package/dist/Toast/toast-modal.d.ts +0 -18
  239. package/dist/Toast/toast-modal.js +0 -112
  240. package/dist/Toast/toast.d.ts +0 -7
  241. package/dist/Toast/toast.js +0 -78
  242. package/dist/VerificationCodeInput/demo/base.d.ts +0 -3
  243. package/dist/VerificationCodeInput/demo/base.js +0 -11
  244. package/dist/VerificationCodeInput/index.d.ts +0 -3
  245. package/dist/VerificationCodeInput/index.js +0 -2
  246. package/dist/VerificationCodeInput/style.scss +0 -20
  247. package/dist/VerificationCodeInput/verification-code-input.d.ts +0 -24
  248. package/dist/VerificationCodeInput/verification-code-input.js +0 -99
  249. /package/dist/{PickerView → Form}/types.js +0 -0
@@ -75,11 +75,14 @@ var VerticalStepIem = function VerticalStepIem(_ref) {
75
75
  }, title && /*#__PURE__*/React.createElement("div", null, title), description && /*#__PURE__*/React.createElement("div", null, description)));
76
76
  };
77
77
  export var VerticalSteps = function VerticalSteps(_ref2) {
78
- var current = _ref2.current,
78
+ var className = _ref2.className,
79
+ style = _ref2.style,
80
+ current = _ref2.current,
79
81
  _ref2$items = _ref2.items,
80
82
  items = _ref2$items === void 0 ? [] : _ref2$items;
81
83
  return /*#__PURE__*/React.createElement("div", {
82
- className: classNames(clsPrefixSteps, "".concat(clsPrefixSteps, "-vertical"))
84
+ className: classNames(clsPrefixSteps, "".concat(clsPrefixSteps, "-vertical"), className),
85
+ style: style
83
86
  }, items.map(function (item, index) {
84
87
  return /*#__PURE__*/React.createElement(VerticalStepIem, {
85
88
  key: index,
@@ -1,146 +1,153 @@
1
- $clsPrefixSteps: 'triones-antm-steps';
2
- $clsPrefixStep: 'triones-antm-step';
3
-
4
- .#{$clsPrefixSteps} {
5
- &-horizontal {
6
- display: flex;
7
- flex-direction: row;
8
-
9
- .#{$clsPrefixStep} {
10
- //flex: 1 auto;
11
- &-indicator {
12
- display: flex;
13
- flex-direction: row;
14
-
15
- &-icon-before {
16
- flex: 1 auto;
17
- display: flex;
18
- align-items: center;
19
- min-width: 16Px;
20
-
21
- &-line {
22
- height: 1Px;
23
- width: 100%;
24
- }
25
- }
26
-
27
- &-icon {
28
- display: flex;
29
- align-items: center;
30
- justify-content: center;
31
- min-height: 24Px;
32
- }
33
-
34
- &-icon-after {
35
- flex: 1 auto;
36
- display: flex;
37
- align-items: center;
38
- min-width: 16Px;
39
-
40
- &-line {
41
- height: 1Px;
42
- width: 100%;
43
- }
44
- }
45
- }
46
-
47
- &-content {
48
- text-align: center;
49
- }
50
-
51
- &:first-child {
52
- .#{$clsPrefixStep} {
53
- &-indicator {
54
- &-icon-before {
55
- &-line {
56
- display: none;
57
- }
58
- }
59
- }
60
- }
61
- }
62
-
63
- &:last-child {
64
- .#{$clsPrefixStep} {
65
- &-indicator {
66
- &-icon-after {
67
- &-line {
68
- display: none;
69
- }
70
- }
71
- }
72
- }
73
- }
74
- }
75
- }
76
-
77
- &-vertical {
78
- .#{$clsPrefixStep} {
79
- display: flex;
80
- flex-direction: row;
81
-
82
- &-indicator {
83
- display: flex;
84
- flex-direction: column;
85
- padding-inline: 4Px;
86
-
87
- &-icon-before {
88
- display: flex;
89
- justify-content: center;
90
- min-height: 8Px;
91
-
92
- &-line {
93
- width: 1Px;
94
- height: 100%;
95
- }
96
- }
97
-
98
- &-icon {
99
- display: flex;
100
- align-items: center;
101
- justify-content: center;
102
- min-width: 24Px;
103
- }
104
-
105
- &-icon-after {
106
- flex: 1 auto;
107
- display: flex;
108
- justify-content: center;
109
-
110
- &-line {
111
- width: 1Px;
112
- height: 100%;
113
- }
114
- }
115
- }
116
-
117
- &-content {
118
- padding: 4Px;
119
- }
120
-
121
- &:first-child {
122
- .#{$clsPrefixStep} {
123
- &-indicator {
124
- &-icon-before {
125
- &-line {
126
- display: none;
127
- }
128
- }
129
- }
130
- }
131
- }
132
-
133
- &:last-child {
134
- .#{$clsPrefixStep} {
135
- &-indicator {
136
- &-icon-after {
137
- &-line {
138
- display: none;
139
- }
140
- }
141
- }
142
- }
143
- }
144
- }
145
- }
146
- }
1
+ $clsPrefixSteps: 'triones-antm-steps';
2
+ $clsPrefixStep: 'triones-antm-step';
3
+
4
+ .#{$clsPrefixSteps} {
5
+ &-horizontal {
6
+ display: flex;
7
+ flex-direction: row;
8
+
9
+ .#{$clsPrefixStep} {
10
+ //flex: 1 auto;
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 4Px;
14
+ &-indicator {
15
+ display: flex;
16
+ flex-direction: row;
17
+
18
+ &-icon-before {
19
+ flex: 1 auto;
20
+ display: flex;
21
+ align-items: center;
22
+ min-width: 16Px;
23
+
24
+ &-line {
25
+ height: 1Px;
26
+ width: 100%;
27
+ }
28
+ }
29
+
30
+ &-icon {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ min-height: 24Px;
35
+ }
36
+
37
+ &-icon-after {
38
+ flex: 1 auto;
39
+ display: flex;
40
+ align-items: center;
41
+ min-width: 16Px;
42
+
43
+ &-line {
44
+ height: 1Px;
45
+ width: 100%;
46
+ }
47
+ }
48
+ }
49
+
50
+ &-content {
51
+ text-align: center;
52
+ &-title{
53
+
54
+ }
55
+ &-desc{}
56
+ }
57
+
58
+ &:first-child {
59
+ .#{$clsPrefixStep} {
60
+ &-indicator {
61
+ &-icon-before {
62
+ &-line {
63
+ display: none;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ &:last-child {
71
+ .#{$clsPrefixStep} {
72
+ &-indicator {
73
+ &-icon-after {
74
+ &-line {
75
+ display: none;
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ &-vertical {
85
+ .#{$clsPrefixStep} {
86
+ display: flex;
87
+ flex-direction: row;
88
+
89
+ &-indicator {
90
+ display: flex;
91
+ flex-direction: column;
92
+ padding-inline: 4Px;
93
+
94
+ &-icon-before {
95
+ display: flex;
96
+ justify-content: center;
97
+ min-height: 8Px;
98
+
99
+ &-line {
100
+ width: 1Px;
101
+ height: 100%;
102
+ }
103
+ }
104
+
105
+ &-icon {
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ min-width: 24Px;
110
+ }
111
+
112
+ &-icon-after {
113
+ flex: 1 auto;
114
+ display: flex;
115
+ justify-content: center;
116
+
117
+ &-line {
118
+ width: 1Px;
119
+ height: 100%;
120
+ }
121
+ }
122
+ }
123
+
124
+ &-content {
125
+ padding: 4Px;
126
+ }
127
+
128
+ &:first-child {
129
+ .#{$clsPrefixStep} {
130
+ &-indicator {
131
+ &-icon-before {
132
+ &-line {
133
+ display: none;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ &:last-child {
141
+ .#{$clsPrefixStep} {
142
+ &-indicator {
143
+ &-icon-after {
144
+ &-line {
145
+ display: none;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
@@ -5,6 +5,8 @@ export type StepsItemProps = {
5
5
  description?: React.ReactNode;
6
6
  };
7
7
  export type BaseStepsProps = {
8
+ className?: string;
9
+ style?: React.CSSProperties;
8
10
  current?: number;
9
11
  items?: StepsItemProps[];
10
12
  };
@@ -1,128 +1,127 @@
1
- @use "../style/variable" as *;
2
-
3
- $class-prefix-switch: 'triones-antm-switch';
4
-
5
- @keyframes loading-rotate {
6
- 100% {
7
- transform: rotate(1turn);
8
- }
9
- }
10
-
11
- /* prettier-ignore */
12
- .#{$class-prefix-switch} {
13
- --height: 24PX;
14
- --width: 42PX;
15
- --border-width: 2PX;
16
-
17
- display: inline-block;
18
- vertical-align: middle;
19
- box-sizing: border-box;
20
- position: relative;
21
- align-self: center;
22
- cursor: pointer;
23
-
24
- input {
25
- display: none;
26
- }
27
-
28
- &-checkbox {
29
- min-width: var(--width);
30
- height: var(--height);
31
- box-sizing: border-box;
32
- border-radius: 31PX;
33
- background: $trionesBorderColor;
34
- z-index: 0;
35
- overflow: hidden;
36
- line-height: var(--height);
37
-
38
- &:before {
39
- content: ' ';
40
- position: absolute;
41
- left: var(--border-width);
42
- top: var(--border-width);
43
- width: calc(100% - 2 * var(--border-width));
44
- height: calc(var(--height) - 2 * var(--border-width));
45
- border-radius: calc(var(--height) - 2 * var(--border-width));
46
- box-sizing: border-box;
47
- background: var(--triones-antm-color-background);
48
- z-index: 1;
49
- transition: all 200ms;
50
- transform: scale(1);
51
- }
52
- }
53
-
54
- &-handle {
55
- display: flex;
56
- justify-content: center;
57
- align-items: center;
58
- width: calc(var(--height) - 2 * var(--border-width));
59
- height: calc(var(--height) - 2 * var(--border-width));
60
- border-radius: calc(var(--height) - 2 * var(--border-width));
61
- background: $trionesColorTextLightSolid;
62
- position: absolute;
63
- z-index: 2;
64
- top: var(--border-width);
65
- left: var(--border-width);
66
- transition: all 200ms;
67
- box-shadow: 0 0 2PX 0 rgba(0, 0, 0, 0.2),
68
- 0 2PX 11.5PX 0 rgba(0, 0, 0, 0.08),
69
- -1PX 2PX 2PX 0 rgba(0, 0, 0, 0.1);
70
-
71
- &-loading {
72
- color: var(--color,$trionesColorPrimary);
73
- display: inline-block;
74
- height: 100%;
75
- width: 100%;
76
- background: currentColor;
77
- mask-image: var(--maskImage);
78
- -webkit-mask-image: var(--maskImage);
79
- animation: adm-spin-loading-rotate 2s infinite linear;
80
- }
81
- }
82
-
83
- &-inner {
84
- position: relative;
85
- z-index: 1;
86
- display: flex;
87
- justify-content: center;
88
- align-items: center;
89
- margin: 0 8PX 0 calc(var(--height) - var(--border-width) + 5PX);
90
- height: 100%;
91
- color: var(--triones-antm-color-weak);
92
- transition: margin 200ms;
93
- font-size: var(--triones-antm-font-size-7);
94
- }
95
-
96
- /* 选中状态 */
97
- &.#{$class-prefix-switch}-checked {
98
- .#{$class-prefix-switch}-checkbox {
99
- background: var(--checked-color, $trionesColorPrimary);
100
-
101
- &:before {
102
- transform: scale(0);
103
- }
104
- }
105
-
106
- .#{$class-prefix-switch}-handle {
107
- left: calc(100% - (var(--height) - var(--border-width)));
108
- }
109
-
110
- .#{$class-prefix-switch}-inner {
111
- margin: 0 calc(var(--height) - var(--border-width) + 5PX) 0 8PX;
112
- color: $trionesColorTextLightSolid;
113
- }
114
- }
115
-
116
- /* 禁用状态 */
117
- &.#{$class-prefix-switch}-disabled {
118
- cursor: not-allowed;
119
- opacity: 0.4;
120
- }
121
-
122
- /* loading图标 */
123
- &-spin-icon {
124
- width: 14PX;
125
- height: 14PX;
126
- animation: loading-rotate 1s linear infinite;
127
- }
128
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $class-prefix-switch: 'triones-antm-switch';
4
+
5
+ @keyframes loading-rotate {
6
+ 100% {
7
+ transform: rotate(1turn);
8
+ }
9
+ }
10
+
11
+ /* prettier-ignore */
12
+ .#{$class-prefix-switch} {
13
+ --height: 24PX;
14
+ --width: 42PX;
15
+ --border-width: 2PX;
16
+
17
+ display: inline-block;
18
+ vertical-align: middle;
19
+ box-sizing: border-box;
20
+ position: relative;
21
+ cursor: pointer;
22
+
23
+ input {
24
+ display: none;
25
+ }
26
+
27
+ &-checkbox {
28
+ min-width: var(--width);
29
+ height: var(--height);
30
+ box-sizing: border-box;
31
+ border-radius: 31PX;
32
+ background: variable.$trionesBorderColor;
33
+ z-index: 0;
34
+ overflow: hidden;
35
+ line-height: var(--height);
36
+
37
+ &:before {
38
+ content: ' ';
39
+ position: absolute;
40
+ left: var(--border-width);
41
+ top: var(--border-width);
42
+ width: calc(100% - 2 * var(--border-width));
43
+ height: calc(var(--height) - 2 * var(--border-width));
44
+ border-radius: calc(var(--height) - 2 * var(--border-width));
45
+ box-sizing: border-box;
46
+ background: var(--triones-antm-color-background);
47
+ z-index: 1;
48
+ transition: all 200ms;
49
+ transform: scale(1);
50
+ }
51
+ }
52
+
53
+ &-handle {
54
+ display: flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ width: calc(var(--height) - 2 * var(--border-width));
58
+ height: calc(var(--height) - 2 * var(--border-width));
59
+ border-radius: calc(var(--height) - 2 * var(--border-width));
60
+ background: variable.$trionesColorTextLightSolid;
61
+ position: absolute;
62
+ z-index: 2;
63
+ top: var(--border-width);
64
+ left: var(--border-width);
65
+ transition: all 200ms;
66
+ box-shadow: 0 0 2PX 0 rgba(0, 0, 0, 0.2),
67
+ 0 2PX 11.5PX 0 rgba(0, 0, 0, 0.08),
68
+ -1PX 2PX 2PX 0 rgba(0, 0, 0, 0.1);
69
+
70
+ &-loading {
71
+ color: var(--color,variable.$trionesColorPrimary);
72
+ display: inline-block;
73
+ height: 100%;
74
+ width: 100%;
75
+ background: currentColor;
76
+ mask-image: var(--maskImage);
77
+ -webkit-mask-image: var(--maskImage);
78
+ animation: adm-spin-loading-rotate 2s infinite linear;
79
+ }
80
+ }
81
+
82
+ &-inner {
83
+ position: relative;
84
+ z-index: 1;
85
+ display: flex;
86
+ justify-content: center;
87
+ align-items: center;
88
+ margin: 0 8PX 0 calc(var(--height) - var(--border-width) + 5PX);
89
+ height: 100%;
90
+ color: var(--triones-antm-color-weak);
91
+ transition: margin 200ms;
92
+ font-size: var(--triones-antm-font-size-7);
93
+ }
94
+
95
+ /* 选中状态 */
96
+ &.#{$class-prefix-switch}-checked {
97
+ .#{$class-prefix-switch}-checkbox {
98
+ background: var(--checked-color, variable.$trionesColorPrimary);
99
+
100
+ &:before {
101
+ transform: scale(0);
102
+ }
103
+ }
104
+
105
+ .#{$class-prefix-switch}-handle {
106
+ left: calc(100% - (var(--height) - var(--border-width)));
107
+ }
108
+
109
+ .#{$class-prefix-switch}-inner {
110
+ margin: 0 calc(var(--height) - var(--border-width) + 5PX) 0 8PX;
111
+ color: variable.$trionesColorTextLightSolid;
112
+ }
113
+ }
114
+
115
+ /* 禁用状态 */
116
+ &.#{$class-prefix-switch}-disabled {
117
+ cursor: not-allowed;
118
+ opacity: 0.4;
119
+ }
120
+
121
+ /* loading图标 */
122
+ &-spin-icon {
123
+ width: 14PX;
124
+ height: 14PX;
125
+ animation: loading-rotate 1s linear infinite;
126
+ }
127
+ }
@@ -14,6 +14,8 @@ export type SwitchProps = {
14
14
  checkedColor?: string;
15
15
  width?: number;
16
16
  height?: number;
17
+ value?: boolean;
18
+ defaultValue?: boolean;
17
19
  };
18
20
  export declare function createSvgStr(props: {
19
21
  stroke: string;
@@ -23,27 +23,28 @@ import Base64 from "crypto-js/enc-base64";
23
23
  import Utf8 from "crypto-js/enc-utf8";
24
24
  var classPrefix = "triones-antm-switch";
25
25
  var defaultProps = {
26
- defaultChecked: false
26
+ defaultChecked: false,
27
+ defaultValue: false
27
28
  };
28
29
  export function createSvgStr(props) {
29
30
  return "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"width:100%;height:100%\" viewBox=\"0 0 20 20\">\n <circle r=\"9\" cx=\"10\" cy=\"10\"\n stroke-width=\"1\"\n stroke=\"".concat(props.stroke, "\"\n fill=\"transparent\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"").concat(10 * 3.14159265358979 * 2, "\"\n stroke-dashoffset=\"").concat(10 * 3.14159265358979 * 0.5, "\"></circle>\n </svg>");
30
31
  }
31
32
  export var Switch = function Switch(p) {
32
- var _props$checked;
33
+ var _ref, _ref2, _ref3, _props$checked;
33
34
  var props = mergeProps(defaultProps, p);
34
35
  var disabled = props.disabled || props.loading || false;
35
36
  var _useState = useState(false),
36
37
  _useState2 = _slicedToArray(_useState, 2),
37
38
  changing = _useState2[0],
38
39
  setChanging = _useState2[1];
39
- var _useState3 = useState((_props$checked = props.checked) !== null && _props$checked !== void 0 ? _props$checked : props.defaultChecked),
40
+ var _useState3 = useState((_ref = (_ref2 = (_ref3 = (_props$checked = props.checked) !== null && _props$checked !== void 0 ? _props$checked : props.value) !== null && _ref3 !== void 0 ? _ref3 : props.defaultChecked) !== null && _ref2 !== void 0 ? _ref2 : props.defaultValue) !== null && _ref !== void 0 ? _ref : false),
40
41
  _useState4 = _slicedToArray(_useState3, 2),
41
42
  checked = _useState4[0],
42
43
  setChecked = _useState4[1];
43
44
  var _ConfigProvider$useCo = ConfigProvider.useConfig(),
44
45
  locale = _ConfigProvider$useCo.locale;
45
46
  var handleClick = /*#__PURE__*/function () {
46
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
47
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
47
48
  return _regeneratorRuntime().wrap(function _callee$(_context) {
48
49
  while (1) switch (_context.prev = _context.next) {
49
50
  case 0:
@@ -55,7 +56,7 @@ export var Switch = function Switch(p) {
55
56
  }, _callee);
56
57
  }));
57
58
  return function handleClick() {
58
- return _ref.apply(this, arguments);
59
+ return _ref4.apply(this, arguments);
59
60
  };
60
61
  }();
61
62
  var completedStyle = React.useMemo(function () {
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
  import React from "react";
5
5
  import { FaceRecognitionOutline, AppstoreOutline, UserOutline } from "../../../../antd-mobile-icons-react";
@@ -1,3 +1,4 @@
1
- import { TabBar as InternalTabBar } from "./tab-bar";
1
+ import { TabBar as InternalTabBar, TabBarItem } from "./tab-bar";
2
2
  var TabBar = InternalTabBar;
3
+ TabBar.Item = TabBarItem;
3
4
  export default TabBar;