@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
@@ -1,9 +1,3 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
2
  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."); }
9
3
  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); }
@@ -16,9 +10,8 @@ export default function useForm(form) {
16
10
  var _useRcForm = useRcForm(),
17
11
  _useRcForm2 = _slicedToArray(_useRcForm, 1),
18
12
  rcForm = _useRcForm2[0];
19
- var itemsRef = React.useRef({});
20
13
  var wrapForm = React.useMemo(function () {
21
- return form !== null && form !== void 0 ? form : _objectSpread({}, rcForm);
14
+ return form !== null && form !== void 0 ? form : rcForm;
22
15
  }, [form, rcForm]);
23
16
  return [wrapForm];
24
17
  }
@@ -1,6 +1,5 @@
1
1
  import { FormContext } from "../context";
2
2
  import React from "react";
3
3
  export function useFormContext() {
4
- var formContext = React.useContext(FormContext);
5
- return formContext;
4
+ return React.useContext(FormContext);
6
5
  }
@@ -1,12 +1,17 @@
1
+ import FieldForm, { Field } from 'rc-field-form';
1
2
  import InternalForm, { FormProps, useWatch } from "./form";
2
- import FormItem, { FormItemProps } from "./FormItem";
3
+ import { ErrorList } from "./ErrorList";
3
4
  import useForm from "./hooks/useForm";
5
+ import { FormItemLayout, FormLayout, FormHorizontalAlign, FormItemVerticalAlign } from "./types";
6
+ export { Field };
7
+ export { useFormContext } from "./hooks/useFormContext";
4
8
  type InternalFormType = typeof InternalForm;
5
9
  type CompoundedComponent = InternalFormType & {
6
10
  useForm: typeof useForm;
7
- Item: typeof FormItem;
11
+ List: typeof FieldForm.List;
12
+ ErrorList: typeof ErrorList;
8
13
  useWatch: typeof useWatch;
9
14
  };
10
15
  declare const Form: CompoundedComponent;
11
- export type { FormProps, FormItemProps };
16
+ export type { FormProps, FormLayout, FormItemLayout, FormHorizontalAlign, FormItemVerticalAlign, };
12
17
  export default Form;
@@ -1,8 +1,13 @@
1
+ import FieldForm, { Field } from 'rc-field-form';
1
2
  import InternalForm, { useWatch } from "./form";
2
- import FormItem from "./FormItem";
3
+ import { ErrorList } from "./ErrorList";
3
4
  import useForm from "./hooks/useForm";
5
+ export { Field };
6
+ export { useFormContext } from "./hooks/useFormContext";
4
7
  var Form = InternalForm;
8
+ Form.List = FieldForm.List;
9
+ Form.ErrorList = ErrorList;
5
10
  Form.useForm = useForm;
6
- Form.Item = FormItem;
11
+ // Form.Item = FormItem;
7
12
  Form.useWatch = useWatch;
8
13
  export default Form;
@@ -0,0 +1,11 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ .triones-antm-form{
4
+ &-item{
5
+ &-explain-error{
6
+ font-size: variable.$trionesFontSizeSm;
7
+ color: variable.$trionesColorError;
8
+ }
9
+ }
10
+
11
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export type RequiredMark = boolean | 'optional' | ((labelNode: React.ReactNode, info: {
3
+ required: boolean;
4
+ }) => React.ReactNode);
5
+ export type FormLayout = 'horizontal' | 'inline' | 'vertical';
6
+ export type FormItemLayout = 'horizontal' | 'vertical';
7
+ export type FormHorizontalAlign = 'start' | 'end';
8
+ export type FormItemVerticalAlign = 'start' | 'center';
@@ -0,0 +1,21 @@
1
+ import React, { FC, PropsWithChildren } from "react";
2
+ import { AntSize } from "../types";
3
+ export type VariantType = 'outlined' | 'borderless' | 'filled' | 'underlined' | undefined;
4
+ export type FormCellProps = {
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ styles?: {
8
+ root?: React.CSSProperties;
9
+ content?: React.CSSProperties;
10
+ extra?: React.CSSProperties;
11
+ arrow?: React.CSSProperties;
12
+ };
13
+ size?: AntSize;
14
+ variant?: VariantType;
15
+ placeholder?: string;
16
+ onClick?: () => void;
17
+ extra?: React.ReactNode;
18
+ arrow?: boolean | React.ReactNode;
19
+ align?: 'start' | 'center' | 'end';
20
+ };
21
+ export declare const FormCell: FC<PropsWithChildren<FormCellProps>>;
@@ -0,0 +1,56 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
+ import { RightOutline } from "@trionesdev/antd-mobile-icons-react";
10
+ import ConfigProvider from "../ConfigProvider";
11
+ import { mergeProp } from "../utils/with-default-props";
12
+ var cls = 'triones-antm-form-cell';
13
+ var defaultArrowIcon = /*#__PURE__*/React.createElement(RightOutline, null);
14
+ export var FormCell = function FormCell(_ref) {
15
+ var className = _ref.className,
16
+ style = _ref.style,
17
+ styles = _ref.styles,
18
+ children = _ref.children,
19
+ _ref$size = _ref.size,
20
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
21
+ _ref$variant = _ref.variant,
22
+ variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
23
+ placeholder = _ref.placeholder,
24
+ extra = _ref.extra,
25
+ _ref$arrow = _ref.arrow,
26
+ arrow = _ref$arrow === void 0 ? false : _ref$arrow,
27
+ _ref$align = _ref.align,
28
+ align = _ref$align === void 0 ? 'left' : _ref$align,
29
+ onClick = _ref.onClick;
30
+ var _ConfigProvider$useCo = ConfigProvider.useConfig(),
31
+ _ConfigProvider$useCo2 = _ConfigProvider$useCo.form,
32
+ componentConfig = _ConfigProvider$useCo2 === void 0 ? {} : _ConfigProvider$useCo2;
33
+ var mergedArrow = function () {
34
+ if (arrow === false || arrow === undefined || arrow === null) return null;
35
+ if (arrow === true) {
36
+ return mergeProp(defaultArrowIcon, componentConfig.arrowIcon);
37
+ }
38
+ return arrow;
39
+ }();
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: classNames("".concat(cls), "".concat(cls, "-").concat(align), "".concat(cls, "-").concat(size), "".concat(cls, "-").concat(variant), className),
42
+ style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
43
+ onClick: onClick
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: classNames("".concat(cls, "-content")),
46
+ style: styles === null || styles === void 0 ? void 0 : styles.content
47
+ }, children || placeholder && /*#__PURE__*/React.createElement("div", {
48
+ className: classNames("".concat(cls, "-placeholder"))
49
+ }, placeholder)), extra && /*#__PURE__*/React.createElement("div", {
50
+ className: classNames("".concat(cls, "-extra")),
51
+ style: styles === null || styles === void 0 ? void 0 : styles.extra
52
+ }, extra), mergedArrow && /*#__PURE__*/React.createElement("div", {
53
+ className: classNames("".concat(cls, "-arrow")),
54
+ style: styles === null || styles === void 0 ? void 0 : styles.arrow
55
+ }, mergedArrow));
56
+ };
@@ -0,0 +1,4 @@
1
+ import { FormCell, FormCellProps } from "./FormCell";
2
+ import "./styles.scss";
3
+ export type { FormCellProps };
4
+ export default FormCell;
@@ -0,0 +1,3 @@
1
+ import { FormCell } from "./FormCell";
2
+ import "./styles.scss";
3
+ export default FormCell;
@@ -0,0 +1,103 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ $cellCls: 'triones-antm-form-cell';
4
+
5
+ .#{$cellCls} {
6
+ width: 100%;
7
+ display: flex;
8
+ flex-direction: row;
9
+ gap: 4Px;
10
+ align-items: center;
11
+
12
+ &-content {
13
+ flex: 1 auto;
14
+ display: flex;
15
+ align-items: center;
16
+ min-height: 20Px;
17
+ }
18
+
19
+ &-placeholder {
20
+ font-size: variable.$trionesFontSize;
21
+ color: variable.$trionesColorTextPlaceholder;
22
+ //width: 100%;
23
+ }
24
+
25
+ &-extra {
26
+ flex-shrink: 0;
27
+ }
28
+
29
+ &-arrow {
30
+ flex-shrink: 0;
31
+
32
+ .triones-antm-icon {
33
+ color: variable.$trionesColorTextPlaceholder;
34
+ font-size: variable.$trionesFontSize;
35
+ }
36
+ }
37
+
38
+ &-small {
39
+ min-height: 20Px;
40
+ }
41
+
42
+ &-medium {
43
+ //min-height: 32Px;
44
+ }
45
+
46
+ &-large {
47
+ min-height: 40Px;
48
+ }
49
+
50
+ &-start {
51
+ .#{$cellCls} {
52
+ &-content {
53
+ justify-content: flex-start;
54
+ }
55
+ }
56
+ }
57
+
58
+ &-center {
59
+ .#{$cellCls} {
60
+ &-content {
61
+ justify-content: center;
62
+ }
63
+ }
64
+ }
65
+
66
+ &-end {
67
+ .#{$cellCls} {
68
+ &-content {
69
+ justify-content: flex-end;
70
+ }
71
+ }
72
+ }
73
+
74
+ &-borderless {
75
+ border: 0;
76
+ }
77
+
78
+ &-outlined {
79
+ border-radius: variable.$trionesBorderRadius;
80
+ border: 1Px solid variable.$trionesBorderColor;
81
+ padding-inline: 4Px;
82
+ box-sizing: border-box;
83
+ min-height: variable.$trionesControlHeight;
84
+ }
85
+
86
+ &-filled {
87
+ border-radius: variable.$trionesBorderRadius;
88
+ background-color: variable.$trionesColorFillTertiary;
89
+ padding-inline: 4Px;
90
+ box-sizing: border-box;
91
+ border: 0;
92
+ min-height: variable.$trionesControlHeight;
93
+ }
94
+
95
+ &-underlined {
96
+ border-top: 0;
97
+ border-left: 0;
98
+ border-right: 0;
99
+ border-bottom: 1Px solid variable.$trionesBorderColor;
100
+ box-sizing: border-box;
101
+ min-height: variable.$trionesControlHeight;
102
+ }
103
+ }
@@ -1,17 +1,17 @@
1
- $class-prefix-grid: 'triones-antm-grid';
2
- /* prettier-ignore */
3
- .#{$class-prefix-grid} {
4
- --gap: 0;
5
- --gap-horizontal: var(--gap);
6
- --gap-vertical: var(--gap);
7
-
8
- display: grid;
9
- grid-gap: 10PX;
10
- column-gap: var(--gap-horizontal);
11
- row-gap: var(--gap-vertical);
12
- grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
13
- align-items: stretch;
14
- &-item {
15
- grid-column-end: span var(--item-span);
16
- }
17
- }
1
+ $class-prefix-grid: 'triones-antm-grid';
2
+ /* prettier-ignore */
3
+ .#{$class-prefix-grid} {
4
+ --gap: 0;
5
+ --gap-horizontal: var(--gap);
6
+ --gap-vertical: var(--gap);
7
+
8
+ display: grid;
9
+ grid-gap: 10PX;
10
+ column-gap: var(--gap-horizontal);
11
+ row-gap: var(--gap-vertical);
12
+ grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
13
+ align-items: stretch;
14
+ &-item {
15
+ grid-column-end: span var(--item-span);
16
+ }
17
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
  import React from "react";
5
5
  import * as icons from "../../../../antd-mobile-icons-react";
@@ -0,0 +1,9 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface IndexedStackProps {
3
+ children: ReactNode[];
4
+ activeIndex: number;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ declare const IndexedStack: React.FC<IndexedStackProps>;
9
+ export { IndexedStack };
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ var IndexedStack = function IndexedStack(_ref) {
3
+ var children = _ref.children,
4
+ _ref$activeIndex = _ref.activeIndex,
5
+ activeIndex = _ref$activeIndex === void 0 ? 0 : _ref$activeIndex,
6
+ className = _ref.className,
7
+ style = _ref.style;
8
+ // 确保 activeIndex 在有效范围内
9
+ var validActiveIndex = Math.max(0, Math.min(activeIndex, children.length - 1));
10
+ return /*#__PURE__*/React.createElement("div", {
11
+ className: className,
12
+ style: style
13
+ }, React.Children.map(children, function (child, index) {
14
+ if (! /*#__PURE__*/React.isValidElement(child)) {
15
+ return null;
16
+ }
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ key: index,
19
+ style: {
20
+ display: index === validActiveIndex ? 'block' : 'none',
21
+ width: '100%',
22
+ height: '100%'
23
+ }
24
+ }, child);
25
+ }));
26
+ };
27
+ export { IndexedStack };
@@ -0,0 +1,3 @@
1
+ import { IndexedStack, IndexedStackProps } from './IndexedStack';
2
+ export type { IndexedStackProps };
3
+ export default IndexedStack;
@@ -0,0 +1,2 @@
1
+ import { IndexedStack } from "./IndexedStack";
2
+ export default IndexedStack;
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import { FC } from "react";
1
+ import React, { FC } from "react";
3
2
  import "./style.scss";
4
3
  export type InputNumberProps = {
5
4
  value?: number;
@@ -7,6 +6,8 @@ export type InputNumberProps = {
7
6
  step?: number;
8
7
  min?: number;
9
8
  max?: number;
9
+ disabled?: boolean;
10
+ block?: boolean;
10
11
  className?: string;
11
12
  style?: React.CSSProperties;
12
13
  };
@@ -8,62 +8,84 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
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
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
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useEffect } from "react";
11
+ import React, { useEffect, useState } from "react";
12
12
  import classNames from "classnames";
13
- import { AddOutline, MinusOutline } from "../../../antd-mobile-icons-react";
13
+ import { AddOutline, MinusOutline } from "@trionesdev/antd-mobile-icons-react";
14
14
  import "./style.scss";
15
+ function clampValue(n, min, max) {
16
+ var v = n;
17
+ if (min !== undefined) v = Math.max(min, v);
18
+ if (max !== undefined) v = Math.min(max, v);
19
+ return v;
20
+ }
15
21
  export var InputNumber = function InputNumber(_ref) {
16
22
  var value = _ref.value,
17
- _onChange = _ref.onChange,
23
+ onChange = _ref.onChange,
18
24
  step = _ref.step,
19
25
  min = _ref.min,
20
26
  max = _ref.max,
27
+ _ref$disabled = _ref.disabled,
28
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
29
+ _ref$block = _ref.block,
30
+ block = _ref$block === void 0 ? false : _ref$block,
21
31
  className = _ref.className,
22
32
  style = _ref.style;
23
- var _React$useState = React.useState(value || 0),
24
- _React$useState2 = _slicedToArray(_React$useState, 2),
25
- internalValue = _React$useState2[0],
26
- setInternalValue = _React$useState2[1];
33
+ var _useState = useState(value !== null && value !== void 0 ? value : 0),
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ internalValue = _useState2[0],
36
+ setInternalValue = _useState2[1];
37
+ var stepSize = step !== null && step !== void 0 ? step : 1;
27
38
  useEffect(function () {
28
39
  if (value !== undefined) {
29
- if (value !== internalValue) {
30
- setInternalValue(value);
31
- }
40
+ setInternalValue(clampValue(value, min, max));
32
41
  }
33
- }, [value]);
42
+ }, [value, min, max]);
34
43
  var minMatch = min !== undefined && internalValue <= min;
35
44
  var maxMatch = max !== undefined && internalValue >= max;
36
45
  var trionesInputNumberCls = 'triones-antm-input-number';
46
+ var setValue = function setValue(next) {
47
+ var clamped = clampValue(next, min, max);
48
+ setInternalValue(clamped);
49
+ onChange === null || onChange === void 0 || onChange(clamped);
50
+ };
37
51
  return /*#__PURE__*/React.createElement("div", {
38
- className: classNames(trionesInputNumberCls, className),
52
+ className: classNames(trionesInputNumberCls, _defineProperty({}, "".concat(trionesInputNumberCls, "--block"), block), className),
39
53
  style: style
40
54
  }, /*#__PURE__*/React.createElement("div", {
41
- className: classNames("".concat(trionesInputNumberCls, "-button"), _defineProperty({}, "".concat(trionesInputNumberCls, "-button-disabled"), minMatch)),
55
+ className: classNames("".concat(trionesInputNumberCls, "-button"), _defineProperty({}, "".concat(trionesInputNumberCls, "-button-disabled"), minMatch || disabled)),
56
+ role: "button",
57
+ tabIndex: disabled || minMatch ? -1 : 0,
42
58
  onClick: function onClick() {
43
- if (minMatch) {
59
+ if (minMatch || disabled) {
44
60
  return;
45
61
  }
46
- var newValue = internalValue - (step || 1);
47
- setInternalValue(newValue);
48
- _onChange === null || _onChange === void 0 || _onChange(newValue);
62
+ setValue(internalValue - stepSize);
49
63
  }
50
- }, /*#__PURE__*/React.createElement(MinusOutline, null)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
64
+ }, /*#__PURE__*/React.createElement(MinusOutline, null)), /*#__PURE__*/React.createElement("div", {
65
+ className: "".concat(trionesInputNumberCls, "-input")
66
+ }, /*#__PURE__*/React.createElement("input", {
51
67
  type: "number",
68
+ disabled: disabled,
69
+ min: min,
70
+ max: max,
71
+ step: stepSize,
52
72
  value: internalValue,
53
73
  onChange: function onChange(e) {
54
- var newVal = Number(e.target.value);
55
- setInternalValue(newVal);
56
- _onChange === null || _onChange === void 0 || _onChange(newVal);
74
+ var num = Number(e.target.value);
75
+ if (!Number.isFinite(num)) {
76
+ return;
77
+ }
78
+ setValue(num);
57
79
  }
58
80
  })), /*#__PURE__*/React.createElement("div", {
59
- className: classNames("".concat(trionesInputNumberCls, "-button"), _defineProperty({}, "".concat(trionesInputNumberCls, "-button-disabled"), maxMatch)),
81
+ className: classNames("".concat(trionesInputNumberCls, "-button"), _defineProperty({}, "".concat(trionesInputNumberCls, "-button-disabled"), maxMatch || disabled)),
82
+ role: "button",
83
+ tabIndex: disabled || maxMatch ? -1 : 0,
60
84
  onClick: function onClick() {
61
- if (maxMatch) {
85
+ if (maxMatch || disabled) {
62
86
  return;
63
87
  }
64
- var newVal = internalValue + (step || 1);
65
- setInternalValue(newVal);
66
- _onChange === null || _onChange === void 0 || _onChange(newVal);
88
+ setValue(internalValue + stepSize);
67
89
  }
68
90
  }, /*#__PURE__*/React.createElement(AddOutline, null)));
69
91
  };
@@ -1,43 +1,100 @@
1
- @use "../style/variable" as *;
2
- $trionesInputNumberCls: 'triones-antm-input-number';
3
-
4
- .#{$trionesInputNumberCls} {
5
- 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;
16
- }
17
-
18
- border: 0;
19
- text-align: center;
20
- width: 30Px;
21
-
22
- &:focus {
23
- outline: none;
24
- }
25
- }
26
-
27
- &-button {
28
- cursor: pointer;
29
- display: flex;
30
- font-size: 10Px;
31
- height: 20Px;
32
- width: 20Px;
33
- justify-content: center;
34
- align-items: center;
35
- &-disabled{
36
- cursor: not-allowed;
37
- color: $trionesColorTextDisabled;
38
- }
39
- .triones-antm-icon{
40
- font-size: 10Px!important;
41
- }
42
- }
43
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $trionesInputNumberCls: 'triones-antm-input-number';
4
+
5
+ $inputNumberBg: #F5F5F5;
6
+ $inputSm: 24Px;
7
+ $inputLg: 40Px;
8
+ $inputNumberControlHeight: 28Px;
9
+
10
+ .#{$trionesInputNumberCls} {
11
+ display: inline-flex;
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;
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;
33
+
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
+ }
61
+
62
+ &:disabled {
63
+ color: variable.$trionesColorTextDisabled;
64
+ cursor: not-allowed;
65
+ }
66
+ }
67
+ }
68
+
69
+ &-button {
70
+ cursor: pointer;
71
+ display: flex;
72
+ flex-shrink: 0;
73
+ font-size: 10Px;
74
+ height: $inputNumberControlHeight;
75
+ width: $inputNumberControlHeight;
76
+ justify-content: center;
77
+ align-items: center;
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 {
92
+ cursor: not-allowed;
93
+ color: variable.$trionesColorTextDisabled;
94
+ }
95
+
96
+ .triones-antm-icon {
97
+ font-size: 10Px !important;
98
+ }
99
+ }
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>;