@trionesdev/antd-taro-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 (179) 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/Button/button.d.ts +2 -1
  8. package/dist/Button/button.js +2 -3
  9. package/dist/Button/style.scss +246 -231
  10. package/dist/Calendar/calendar-grid.d.ts +10 -9
  11. package/dist/Calendar/calendar-grid.js +37 -62
  12. package/dist/Calendar/calendar-header.d.ts +3 -2
  13. package/dist/Calendar/calendar-header.js +9 -6
  14. package/dist/Calendar/calendar-range.d.ts +4 -3
  15. package/dist/Calendar/calendar-range.js +22 -18
  16. package/dist/Calendar/calendar.d.ts +5 -4
  17. package/dist/Calendar/calendar.js +30 -17
  18. package/dist/Calendar/style.scss +88 -85
  19. package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
  20. package/dist/Calendar/touchable-calendar-grid.js +96 -95
  21. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
  22. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +40 -57
  23. package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
  24. package/dist/CalendarDatetimePicker/DateTimeSwitch.js +2 -2
  25. package/dist/CalendarDatetimePicker/style.scss +62 -54
  26. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +9 -0
  27. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +60 -0
  28. package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
  29. package/dist/CalendarDatetimePickerCell/index.js +2 -0
  30. package/dist/CalendarPicker/{calendar-picker.js → CalendarPicker.js} +10 -6
  31. package/dist/CalendarPicker/{calendar-range-picker.js → CalendarRangePicker.js} +8 -6
  32. package/dist/CalendarPicker/index.d.ts +3 -4
  33. package/dist/CalendarPicker/index.js +2 -2
  34. package/dist/CalendarPicker/style.scss +32 -31
  35. package/dist/CalendarPicker/types.d.ts +8 -6
  36. package/dist/CalendarPicker/types.js +1 -1
  37. package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
  38. package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
  39. package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
  40. package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
  41. package/dist/CalendarPickerCell/index.d.ts +8 -0
  42. package/dist/CalendarPickerCell/index.js +5 -0
  43. package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
  44. package/dist/CascaderPicker/cascader-picker.js +90 -0
  45. package/dist/CascaderPicker/index.d.ts +1 -1
  46. package/dist/CascaderPicker/index.js +1 -1
  47. package/dist/CascaderPicker/style.scss +45 -0
  48. package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +20 -0
  49. package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
  50. package/dist/CascaderPickerCell/index.d.ts +3 -0
  51. package/dist/CascaderPickerCell/index.js +2 -0
  52. package/dist/DatePicker/DatePicker.d.ts +18 -0
  53. package/dist/DatePicker/DatePicker.js +310 -0
  54. package/dist/DatePicker/index.d.ts +4 -0
  55. package/dist/DatePicker/index.js +3 -0
  56. package/dist/DatePicker/style.scss +41 -0
  57. package/dist/DatePicker/types.d.ts +1 -0
  58. package/dist/DatePicker/types.js +1 -0
  59. package/dist/DatePickerCell/DatePickerCell.d.ts +16 -0
  60. package/dist/DatePickerCell/DatePickerCell.js +78 -0
  61. package/dist/DatePickerCell/index.d.ts +3 -0
  62. package/dist/DatePickerCell/index.js +2 -0
  63. package/dist/FetchPicker/FetchPicker.d.ts +78 -0
  64. package/dist/FetchPicker/FetchPicker.js +310 -0
  65. package/dist/FetchPicker/index.d.ts +4 -0
  66. package/dist/FetchPicker/index.js +3 -0
  67. package/dist/FetchPicker/styles.scss +130 -0
  68. package/dist/FloatButton/FloatButton.d.ts +19 -0
  69. package/dist/FloatButton/FloatButton.js +60 -0
  70. package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
  71. package/dist/FloatButton/FloatButtonGroup.js +141 -0
  72. package/dist/FloatButton/context.d.ts +10 -0
  73. package/dist/FloatButton/context.js +2 -0
  74. package/dist/FloatButton/index.d.ts +10 -0
  75. package/dist/FloatButton/index.js +5 -0
  76. package/dist/FloatButton/style.scss +126 -0
  77. package/dist/Form/FormItem/form-item-content.d.ts +17 -0
  78. package/dist/Form/FormItem/form-item-content.js +39 -0
  79. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  80. package/dist/Form/FormItem/form-item-label.js +29 -0
  81. package/dist/Form/FormItem/form-item.d.ts +23 -0
  82. package/dist/Form/FormItem/form-item.js +77 -0
  83. package/dist/Form/FormItem/index.d.ts +5 -0
  84. package/dist/Form/FormItem/index.js +3 -0
  85. package/dist/Form/index.d.ts +9 -2
  86. package/dist/Form/index.js +5 -1
  87. package/dist/Form/style.scss +100 -0
  88. package/dist/FormCell/index.d.ts +3 -0
  89. package/dist/FormCell/index.js +2 -0
  90. package/dist/ImagesPreview/ImagesPreview.js +4 -3
  91. package/dist/ImagesPreview/style.scss +34 -34
  92. package/dist/ImagesWall/ImagesWall.js +1 -1
  93. package/dist/ImagesWall/style.scss +70 -70
  94. package/dist/Input/index.d.ts +17 -2
  95. package/dist/Input/index.js +13 -1
  96. package/dist/Input/index.scss +282 -0
  97. package/dist/Input/input-affix-wrapper.d.ts +13 -0
  98. package/dist/Input/input-affix-wrapper.js +37 -0
  99. package/dist/Input/input-digit.d.ts +7 -0
  100. package/dist/Input/input-digit.js +53 -0
  101. package/dist/Input/input-number.d.ts +7 -0
  102. package/dist/Input/input-number.js +50 -0
  103. package/dist/Input/input-opt.d.ts +16 -0
  104. package/dist/Input/input-opt.js +87 -0
  105. package/dist/Input/input-password.d.ts +8 -0
  106. package/dist/Input/input-password.js +49 -0
  107. package/dist/Input/input.d.ts +3 -0
  108. package/dist/Input/input.js +7 -0
  109. package/dist/Input/taro-input.d.ts +8 -0
  110. package/dist/Input/taro-input.js +70 -0
  111. package/dist/Input/textarea.d.ts +15 -0
  112. package/dist/Input/textarea.js +52 -0
  113. package/dist/Input/types.d.ts +20 -0
  114. package/dist/Input/types.js +2 -0
  115. package/dist/Loading/index.d.ts +4 -0
  116. package/dist/Loading/index.js +3 -0
  117. package/dist/Overlay/Overlay.d.ts +17 -0
  118. package/dist/Overlay/Overlay.js +100 -0
  119. package/dist/Overlay/index.d.ts +4 -0
  120. package/dist/Overlay/index.js +3 -0
  121. package/dist/Overlay/style.scss +20 -0
  122. package/dist/Picker/Picker.d.ts +27 -0
  123. package/dist/Picker/Picker.js +100 -0
  124. package/dist/Picker/index.d.ts +1 -1
  125. package/dist/Picker/index.js +1 -1
  126. package/dist/Picker/style.scss +41 -0
  127. package/dist/PickerView/PickerView.d.ts +4 -0
  128. package/dist/PickerView/PickerView.js +71 -0
  129. package/dist/PickerView/index.d.ts +2 -2
  130. package/dist/PickerView/index.js +1 -1
  131. package/dist/PickerView/style.scss +13 -0
  132. package/dist/PickerView/types.d.ts +15 -0
  133. package/dist/PickerView/types.js +1 -0
  134. package/dist/Popup/Popup.d.ts +48 -0
  135. package/dist/Popup/Popup.js +135 -0
  136. package/dist/Popup/index.d.ts +2 -1
  137. package/dist/Popup/index.js +2 -1
  138. package/dist/Popup/style.scss +126 -0
  139. package/dist/Progress/index.d.ts +1 -1
  140. package/dist/Progress/index.js +1 -1
  141. package/dist/Segmented/index.d.ts +3 -0
  142. package/dist/Segmented/index.js +2 -0
  143. package/dist/SideBar/side-bar.js +9 -8
  144. package/dist/SideBar/style.scss +85 -85
  145. package/dist/Stepper/index.d.ts +3 -0
  146. package/dist/Stepper/index.js +2 -0
  147. package/dist/Toast/Toast.d.ts +18 -0
  148. package/dist/Toast/Toast.js +112 -0
  149. package/dist/Toast/index.d.ts +1 -1
  150. package/dist/Toast/index.js +1 -1
  151. package/dist/Toast/style.scss +63 -0
  152. package/dist/VerificationCodeInput/index.d.ts +2 -2
  153. package/dist/VerificationCodeInput/index.js +1 -1
  154. package/dist/VerificationCodeInput/style.scss +20 -0
  155. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  156. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  157. package/dist/index.d.ts +28 -7
  158. package/dist/index.js +12 -2
  159. package/dist/style/variable.scss +34 -1
  160. package/dist/types.d.ts +0 -1
  161. package/dist/utils/dayjs.d.ts +4 -0
  162. package/dist/utils/dayjs.js +42 -0
  163. package/package.json +25 -30
  164. package/readme.md +23 -23
  165. package/dist/Mask/index.d.ts +0 -3
  166. package/dist/Mask/index.js +0 -2
  167. package/dist/Progress/Progress.d.ts +0 -38
  168. package/dist/Progress/Progress.js +0 -53
  169. package/dist/Progress/ProgressCircle.d.ts +0 -16
  170. package/dist/Progress/ProgressCircle.js +0 -147
  171. package/dist/Progress/ProgressLine.d.ts +0 -15
  172. package/dist/Progress/ProgressLine.js +0 -87
  173. package/dist/Progress/style.scss +0 -33
  174. package/dist/Progress/types.d.ts +0 -4
  175. package/dist/Progress/types.js +0 -2
  176. package/dist/SpinLoading/index.d.ts +0 -3
  177. package/dist/SpinLoading/index.js +0 -2
  178. /package/dist/CalendarPicker/{calendar-picker.d.ts → CalendarPicker.d.ts} +0 -0
  179. /package/dist/CalendarPicker/{calendar-range-picker.d.ts → CalendarRangePicker.d.ts} +0 -0
@@ -0,0 +1,126 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ $trionesPopupCls: 'triones-antm-popup';
4
+
5
+ .#{$trionesPopupCls} {
6
+ position: fixed;
7
+ top: 0;
8
+ bottom: 0;
9
+ left: 0;
10
+ right: 0;
11
+ touch-action: none;
12
+ pointer-events: none;
13
+ opacity: 0;
14
+ transition: opacity 0.3s ease;
15
+
16
+ &-open {
17
+ pointer-events: auto;
18
+ opacity: 1;
19
+ }
20
+
21
+ &-overlay {
22
+ width: 100%;
23
+ height: 100%;
24
+ background-color: rgba(0, 0, 0, .55);
25
+ }
26
+
27
+ &-container {
28
+ position: fixed;
29
+ overflow: hidden;
30
+ background-color: white;
31
+ display: flex;
32
+ flex-direction: column;
33
+ }
34
+
35
+
36
+ &-header {
37
+ display: flex;
38
+ align-items: center;
39
+ padding-block: variable.$trionesPaddingContentVertical;
40
+ padding-inline: variable.$trionesPaddingContentHorizontal;
41
+ border-bottom: 1px solid variable.$trionesBorderColor;
42
+ &-title{
43
+ flex: 1;
44
+ text-align: center;
45
+ font-size: variable.$trionesFontSizeLg;
46
+ }
47
+ }
48
+
49
+ &-body{
50
+ min-height: 0;
51
+ flex: 1;
52
+ }
53
+
54
+ &-top {
55
+ top: 0;
56
+ left: 0;
57
+ right: 0;
58
+ max-height: 100%;
59
+
60
+
61
+ &.#{$trionesPopupCls} {
62
+ &-round {
63
+ border-bottom-left-radius: variable.$trionesBorderRadiusLg;
64
+ border-bottom-right-radius: variable.$trionesBorderRadiusLg;
65
+ }
66
+ }
67
+ }
68
+
69
+ &-bottom {
70
+ bottom: 0;
71
+ left: 0;
72
+ right: 0;
73
+ max-height: 100%;
74
+
75
+
76
+ &.#{$trionesPopupCls} {
77
+ &-round {
78
+ border-top-left-radius: variable.$trionesBorderRadiusLg;
79
+ border-top-right-radius: variable.$trionesBorderRadiusLg;
80
+ }
81
+ }
82
+ }
83
+
84
+ &-left {
85
+ top: 0;
86
+ bottom: 0;
87
+ left: 0;
88
+ max-width: 100%;
89
+
90
+ &.#{$trionesPopupCls} {
91
+ &-round {
92
+ border-top-right-radius: variable.$trionesBorderRadiusLg;
93
+ border-bottom-right-radius: variable.$trionesBorderRadiusLg;
94
+ }
95
+ }
96
+ }
97
+
98
+ &-right {
99
+ top: 0;
100
+ bottom: 0;
101
+ right: 0;
102
+ max-width: 100%;
103
+
104
+ &.#{$trionesPopupCls} {
105
+ &-round {
106
+ border-top-left-radius: variable.$trionesBorderRadiusLg;
107
+ border-bottom-left-radius: variable.$trionesBorderRadiusLg;
108
+ }
109
+ }
110
+ }
111
+
112
+ &-center {
113
+ top: 50%;
114
+ left: 50%;
115
+ transform: translate(-50%, -50%);
116
+ max-width: 100%;
117
+ max-height: 100%;
118
+
119
+ &.#{$trionesPopupCls} {
120
+ &-round {
121
+ border-radius: variable.$trionesBorderRadiusLg;
122
+ }
123
+ }
124
+ }
125
+
126
+ }
@@ -1,3 +1,3 @@
1
- import { Progress, ProgressProps } from "./Progress";
1
+ import { Progress, ProgressProps } from "@trionesdev/antd-mobile-base-react";
2
2
  export type { ProgressProps };
3
3
  export default Progress;
@@ -1,2 +1,2 @@
1
- import { Progress } from "./Progress";
1
+ import { Progress } from "@trionesdev/antd-mobile-base-react";
2
2
  export default Progress;
@@ -0,0 +1,3 @@
1
+ import { Segmented, SegmentedProps } from '@trionesdev/antd-mobile-base-react';
2
+ export type { SegmentedProps };
3
+ export default Segmented;
@@ -0,0 +1,2 @@
1
+ import { Segmented } from '@trionesdev/antd-mobile-base-react';
2
+ export default Segmented;
@@ -106,8 +106,8 @@ var SideBarContent = /*#__PURE__*/memo(function (_ref2) {
106
106
  };
107
107
  }();
108
108
 
109
- /**
110
- * 计算当前页顶部,距离可滚动区域顶部的距离
109
+ /**
110
+ * 计算当前页顶部,距离可滚动区域顶部的距离
111
111
  */
112
112
  var computeReactiveOffsetTop = /*#__PURE__*/function () {
113
113
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
@@ -153,8 +153,8 @@ var SideBarContent = /*#__PURE__*/memo(function (_ref2) {
153
153
  };
154
154
  }();
155
155
 
156
- /**
157
- * 计算当前页底部,距离可滚动区域顶部的距离
156
+ /**
157
+ * 计算当前页底部,距离可滚动区域顶部的距离
158
158
  */
159
159
  var computeReactiveOffsetBottom = /*#__PURE__*/function () {
160
160
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
@@ -232,8 +232,8 @@ var SideBarContent = /*#__PURE__*/memo(function (_ref2) {
232
232
  }
233
233
  }, [activeKey]);
234
234
 
235
- /**
236
- * 监听滚动变化,只有在人为操作的时候才监听滚动的位置是否需要切换tab,如果是切换tab 引发的滚动则不执行
235
+ /**
236
+ * 监听滚动变化,只有在人为操作的时候才监听滚动的位置是否需要切换tab,如果是切换tab 引发的滚动则不执行
237
237
  */
238
238
  useEffect(function () {
239
239
  if (mode === 'scroll' && manual && scrollDetail !== null && scrollDetail !== void 0 && scrollDetail.manual) {
@@ -264,13 +264,14 @@ var SideBarContent = /*#__PURE__*/memo(function (_ref2) {
264
264
  return computeReactiveOffsetBottom();
265
265
  case 6:
266
266
  reactiveOffsetBottom = _context5.sent;
267
- if (!isTaroEnv) {
267
+ if (!isTaroWeApp) {
268
268
  _context5.next = 13;
269
269
  break;
270
270
  }
271
271
  _context5.next = 10;
272
272
  return new Promise(function (resolve) {
273
- Taro.getSystemInfo().then(function (res) {
273
+ var _Taro$getSystemInfo;
274
+ (_Taro$getSystemInfo = Taro.getSystemInfo) === null || _Taro$getSystemInfo === void 0 || _Taro$getSystemInfo.call(Taro).then(function (res) {
274
275
  return resolve(res.windowHeight);
275
276
  });
276
277
  });
@@ -1,85 +1,85 @@
1
- @use "../style/variable" as *;
2
-
3
- $trionesSideBarCls: 'triones-antm-sidebar';
4
-
5
- .#{$trionesSideBarCls} {
6
- display: flex;
7
- height: 100%;
8
-
9
-
10
- &-tabs {
11
- min-width: 0;
12
- background-color: $trionesColorFill;
13
- overflow: auto;
14
- scrollbar-width: thin;
15
- flex-shrink: 0;
16
- }
17
-
18
- &-tab {
19
- cursor: pointer;
20
- padding: $trionesPadding $trionesPadding;
21
- color: $trionesColorTextSecondary;
22
-
23
- &-active {
24
- color: $trionesColorPrimaryText;
25
- background-color: $trionesColorBgBase;
26
- }
27
-
28
- }
29
-
30
- &-content {
31
- flex: 1 auto;
32
- min-width: 0;
33
- overflow: hidden;
34
- //overflow-y: auto;
35
- //scrollbar-width: none;
36
- position: relative;
37
- user-select: none;
38
- touch-action: none;
39
-
40
-
41
- &-wheel {
42
- width: 100%;
43
- cursor: grab;
44
- position: absolute;
45
- }
46
-
47
- &-item {
48
-
49
- &-active {
50
- display: block;
51
- }
52
- }
53
- }
54
-
55
- &-switch-mode {
56
- .#{$trionesSideBarCls} {
57
- &-content {
58
-
59
- &-item {
60
- height: 100%;
61
- display: none;
62
- &-active {
63
- display: block;
64
- }
65
- }
66
- }
67
- }
68
- }
69
-
70
- &-scroll-mode {
71
- .#{$trionesSideBarCls} {
72
- &-content {
73
-
74
- &-item {
75
-
76
-
77
- &-active {
78
- display: block;
79
- }
80
- }
81
- }
82
- }
83
- }
84
-
85
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $trionesSideBarCls: 'triones-antm-sidebar';
4
+
5
+ .#{$trionesSideBarCls} {
6
+ display: flex;
7
+ height: 100%;
8
+
9
+
10
+ &-tabs {
11
+ min-width: 0;
12
+ background-color: variable.$trionesColorFill;
13
+ overflow: auto;
14
+ scrollbar-width: thin;
15
+ flex-shrink: 0;
16
+ }
17
+
18
+ &-tab {
19
+ cursor: pointer;
20
+ padding: variable.$trionesPadding variable.$trionesPadding;
21
+ color: variable.$trionesColorTextSecondary;
22
+
23
+ &-active {
24
+ color: variable.$trionesColorPrimaryText;
25
+ background-color: variable.$trionesColorBgBase;
26
+ }
27
+
28
+ }
29
+
30
+ &-content {
31
+ flex: 1 auto;
32
+ min-width: 0;
33
+ overflow: hidden;
34
+ //overflow-y: auto;
35
+ //scrollbar-width: none;
36
+ position: relative;
37
+ user-select: none;
38
+ touch-action: none;
39
+
40
+
41
+ &-wheel {
42
+ width: 100%;
43
+ cursor: grab;
44
+ position: absolute;
45
+ }
46
+
47
+ &-item {
48
+
49
+ &-active {
50
+ display: block;
51
+ }
52
+ }
53
+ }
54
+
55
+ &-switch-mode {
56
+ .#{$trionesSideBarCls} {
57
+ &-content {
58
+
59
+ &-item {
60
+ height: 100%;
61
+ display: none;
62
+ &-active {
63
+ display: block;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ &-scroll-mode {
71
+ .#{$trionesSideBarCls} {
72
+ &-content {
73
+
74
+ &-item {
75
+
76
+
77
+ &-active {
78
+ display: block;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ }
@@ -0,0 +1,3 @@
1
+ import { Stepper, StepperProps } from "@trionesdev/antd-mobile-base-react";
2
+ export type { StepperProps };
3
+ export default Stepper;
@@ -0,0 +1,2 @@
1
+ import { Stepper } from "@trionesdev/antd-mobile-base-react";
2
+ export default Stepper;
@@ -0,0 +1,18 @@
1
+ import { FC } from "react";
2
+ import React from "react";
3
+ import "./style.scss";
4
+ export type ToastProps = {
5
+ open?: boolean;
6
+ maskClosable?: boolean;
7
+ content?: React.ReactNode;
8
+ duration?: number;
9
+ durationAble?: boolean;
10
+ icon?: 'success' | 'fail' | 'loading' | React.ReactNode;
11
+ maskClassName?: string;
12
+ position?: 'top' | 'bottom' | 'center';
13
+ destroyOnClose?: boolean;
14
+ afterClose?: () => void;
15
+ afterOpenChange?: (open: boolean) => void;
16
+ onDestroy?: () => void;
17
+ };
18
+ export declare const Toast: FC<ToastProps>;
@@ -0,0 +1,112 @@
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import { memo, useEffect, useMemo, useRef, useState } from "react";
12
+ import classNames from "classnames";
13
+ import React from "react";
14
+ import "./style.scss";
15
+ import { SpinLoading } from "../index";
16
+ import Overlay from "../Overlay";
17
+ import { CheckOutline, CloseOutline } from "@trionesdev/antd-mobile-icons-react";
18
+ var toastCls = "triones-antm-toast";
19
+ export var Toast = /*#__PURE__*/memo(function (_ref) {
20
+ var open = _ref.open,
21
+ _ref$maskClosable = _ref.maskClosable,
22
+ maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
23
+ content = _ref.content,
24
+ _ref$duration = _ref.duration,
25
+ duration = _ref$duration === void 0 ? 2000 : _ref$duration,
26
+ _ref$durationAble = _ref.durationAble,
27
+ durationAble = _ref$durationAble === void 0 ? true : _ref$durationAble,
28
+ icon = _ref.icon,
29
+ maskClassName = _ref.maskClassName,
30
+ _ref$position = _ref.position,
31
+ position = _ref$position === void 0 ? 'center' : _ref$position,
32
+ destroyOnClose = _ref.destroyOnClose,
33
+ afterClose = _ref.afterClose,
34
+ afterOpenChange = _ref.afterOpenChange,
35
+ onDestroy = _ref.onDestroy;
36
+ var _useState = useState(open || false),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ internalOpen = _useState2[0],
39
+ setInternalOpen = _useState2[1];
40
+ var time = useRef();
41
+ var handleIcon = function handleIcon() {
42
+ if (icon === 'success') {
43
+ return /*#__PURE__*/React.createElement(CheckOutline, null);
44
+ } else if (icon === 'fail') {
45
+ return /*#__PURE__*/React.createElement(CloseOutline, null);
46
+ } else if (icon === 'loading') {
47
+ return /*#__PURE__*/React.createElement(SpinLoading, {
48
+ color: "white"
49
+ });
50
+ } else {
51
+ return icon;
52
+ }
53
+ };
54
+ useEffect(function () {
55
+ if (open === undefined) {
56
+ return;
57
+ }
58
+ if (open !== internalOpen) {
59
+ setInternalOpen(open);
60
+ }
61
+ }, [open]);
62
+ useEffect(function () {
63
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(internalOpen);
64
+ if (!internalOpen) {
65
+ afterClose === null || afterClose === void 0 || afterClose();
66
+ if (destroyOnClose) {
67
+ onDestroy === null || onDestroy === void 0 || onDestroy();
68
+ }
69
+ clearTimeout(time.current);
70
+ }
71
+ if (durationAble && internalOpen && duration) {
72
+ time.current = setTimeout(function () {
73
+ setInternalOpen(false);
74
+ }, duration);
75
+ }
76
+ }, [internalOpen]);
77
+ var top = useMemo(function () {
78
+ switch (position) {
79
+ case 'top':
80
+ return '20%';
81
+ case 'bottom':
82
+ return '80%';
83
+ default:
84
+ return '50%';
85
+ }
86
+ }, [position]);
87
+ return /*#__PURE__*/React.createElement(Overlay, {
88
+ className: maskClassName,
89
+ open: internalOpen,
90
+ onClick: function onClick() {
91
+ if (maskClosable) {
92
+ setInternalOpen(false);
93
+ }
94
+ }
95
+ }, /*#__PURE__*/React.createElement("div", {
96
+ className: classNames(toastCls)
97
+ }, /*#__PURE__*/React.createElement("div", {
98
+ className: classNames("".concat(toastCls, "-main"), _defineProperty({}, "".concat(toastCls, "-main-icon"), icon)),
99
+ style: {
100
+ top: top
101
+ },
102
+ onClick: function onClick(e) {
103
+ e.stopPropagation();
104
+ }
105
+ }, /*#__PURE__*/React.createElement("div", {
106
+ className: classNames("".concat(toastCls, "-center"))
107
+ }, icon && /*#__PURE__*/React.createElement("div", {
108
+ className: classNames("".concat(toastCls, "-center-icon"))
109
+ }, handleIcon()), content && /*#__PURE__*/React.createElement("div", {
110
+ className: classNames("".concat(toastCls, "-center-content"))
111
+ }, content)))));
112
+ });
@@ -1,3 +1,3 @@
1
- import { Toast, ToastProps } from "@trionesdev/antd-mobile-base-react";
1
+ import { Toast, ToastProps } from "./Toast";
2
2
  export type { ToastProps };
3
3
  export default Toast;
@@ -1,2 +1,2 @@
1
- import { Toast } from "@trionesdev/antd-mobile-base-react";
1
+ import { Toast } from "./Toast";
2
2
  export default Toast;
@@ -0,0 +1,63 @@
1
+ $toastCls: 'triones-antm-toast';
2
+
3
+ .#{$toastCls} {
4
+ position: fixed;
5
+ top: 0;
6
+ left: 0;
7
+ width: 100%;
8
+ height: 100%;
9
+ text-align: center;
10
+ pointer-events: none;
11
+
12
+ &-main {
13
+
14
+ padding: 12Px;
15
+ display: inline-block;
16
+ position: relative;
17
+ top: 50%;
18
+ transform: translateY(-50%);
19
+ width: auto;
20
+ max-width: 204px;
21
+ max-height: 70%;
22
+ overflow: auto;
23
+ color: #fff;
24
+ word-break: break-all;
25
+ background-color: rgba(0, 0, 0, .7);
26
+ border-radius: 8px;
27
+ pointer-events: all;
28
+ font-size: var(--adm-font-size-7);
29
+ line-height: 1.5;
30
+ box-sizing: border-box;
31
+ &-icon{
32
+ padding: 35Px 12Px;
33
+ min-width: 150Px;
34
+ .#{$toastCls}{
35
+ &-center{
36
+ &-center{
37
+ text-align: initial;
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ &-center{
45
+ display: flex;
46
+ flex-direction: column;
47
+ justify-content: center;
48
+ align-items: center;
49
+ gap: 8Px;
50
+ &-icon{
51
+ .triones-antm-icon{
52
+ font-size: 36Px;
53
+ }
54
+ }
55
+ &-content{
56
+ display: inline-block;
57
+ color: #fff;
58
+ word-break: break-all;
59
+ pointer-events: all;
60
+ text-align: initial;
61
+ }
62
+ }
63
+ }
@@ -1,3 +1,3 @@
1
- import { VerificationCodeInput, ValidationCodeInputProps } from "@trionesdev/antd-mobile-base-react";
2
- export type { ValidationCodeInputProps };
1
+ import { VerificationCodeInput, VerificationCodeInputProps } from "./verification-code-input";
2
+ export type { VerificationCodeInputProps };
3
3
  export default VerificationCodeInput;
@@ -1,2 +1,2 @@
1
- import { VerificationCodeInput } from "@trionesdev/antd-mobile-base-react";
1
+ import { VerificationCodeInput } from "./verification-code-input";
2
2
  export default VerificationCodeInput;
@@ -0,0 +1,20 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ $verificationCodeInputCls: 'triones-antm-verification-code-input';
4
+
5
+ .#{$verificationCodeInputCls} {
6
+ &-send {
7
+ padding-inline: variable.$trionesPaddingContentHorizontal;
8
+ cursor: pointer;
9
+
10
+ &:hover {
11
+ color: variable.$trionesColorPrimary;
12
+ }
13
+ }
14
+
15
+ &-counting {
16
+ padding-inline: variable.$trionesPaddingContentHorizontal;
17
+ cursor: not-allowed;
18
+ color: variable.$trionesColorTextDisabled;
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ import { FC } from 'react';
2
+ import { InputProps } from '..';
3
+ import './style.scss';
4
+ export type VerificationCodeInputProps = Omit<InputProps, 'suffix'> & {
5
+ /**
6
+ * @description 发送文本
7
+ * @default 获取验证码
8
+ */
9
+ sendText?: string;
10
+ /**
11
+ * @description 重新发送文本
12
+ * @default 重新发送
13
+ */
14
+ resendText?: string;
15
+ /**
16
+ * @description 等待时间
17
+ */
18
+ waitSeconds?: number;
19
+ /**
20
+ * @description 发送事件
21
+ */
22
+ onSend?: () => Promise<boolean>;
23
+ };
24
+ export declare const VerificationCodeInput: FC<VerificationCodeInputProps>;