@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,47 +1,62 @@
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); }
1
+ var _excluded = ["shape"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
8
  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
9
  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
10
  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
11
  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
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import { CheckOutline } from "../../../antd-mobile-icons-react";
12
- import classNames from 'classnames';
13
- import React, { useEffect, useState } from 'react';
13
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
+ import React, { useContext, useState } from 'react';
14
16
  import "./index.scss";
15
- import { cls } from "./types";
17
+ import { CheckboxRound } from "./checkbox-round";
18
+ import { CheckboxButton } from "./checkbox-button";
19
+ import { CheckboxGroupContext } from "./group-context";
20
+ import { includes } from "lodash-es";
16
21
  export var Checkbox = function Checkbox(_ref) {
17
- var _ref2;
18
- var children = _ref.children,
19
- checked = _ref.checked,
20
- defaultChecked = _ref.defaultChecked,
21
- disabled = _ref.disabled,
22
- onChange = _ref.onChange;
23
- var _useState = useState((_ref2 = checked !== null && checked !== void 0 ? checked : defaultChecked) !== null && _ref2 !== void 0 ? _ref2 : false),
22
+ var _ref2, _ref3, _rest$checked;
23
+ var _ref$shape = _ref.shape,
24
+ shape = _ref$shape === void 0 ? 'round' : _ref$shape,
25
+ rest = _objectWithoutProperties(_ref, _excluded);
26
+ var ctx = useContext(CheckboxGroupContext);
27
+ var _useState = useState((_ref2 = (_ref3 = (_rest$checked = rest.checked) !== null && _rest$checked !== void 0 ? _rest$checked : rest.defaultChecked) !== null && _ref3 !== void 0 ? _ref3 : ctx.group ? includes(ctx.value || [], rest.value) : false) !== null && _ref2 !== void 0 ? _ref2 : false),
24
28
  _useState2 = _slicedToArray(_useState, 2),
25
29
  innerChecked = _useState2[0],
26
30
  setInnerChecked = _useState2[1];
27
- useEffect(function () {
28
- onChange === null || onChange === void 0 || onChange(innerChecked);
29
- }, [innerChecked]);
30
- var prefixCls = "".concat(cls);
31
- return /*#__PURE__*/React.createElement("label", {
32
- className: classNames("".concat(prefixCls, "-wrapper"), _defineProperty({}, "".concat(prefixCls, "-disabled"), disabled)),
33
- onClick: function onClick() {
34
- setInnerChecked(!innerChecked);
31
+ var handleClick = function handleClick() {
32
+ var _rest$onChange;
33
+ var newValue = !innerChecked;
34
+ setInnerChecked(newValue);
35
+ (_rest$onChange = rest.onChange) === null || _rest$onChange === void 0 || _rest$onChange.call(rest, newValue);
36
+ if (ctx.group) {
37
+ var _onValueChange, _ref4;
38
+ var ctxValue = _toConsumableArray(ctx.value || []);
39
+ if (newValue) {
40
+ ctxValue.push(rest.value);
41
+ } else {
42
+ ctxValue = ctxValue.filter(function (v) {
43
+ return v !== rest.value;
44
+ });
45
+ }
46
+ (_onValueChange = (_ref4 = ctx).onValueChange) === null || _onValueChange === void 0 || _onValueChange.call(_ref4, ctxValue);
35
47
  }
36
- }, /*#__PURE__*/React.createElement("div", {
37
- className: classNames("".concat(prefixCls))
38
- }, /*#__PURE__*/React.createElement("div", {
39
- className: classNames("".concat(prefixCls, "-fake"))
40
- }, innerChecked ? /*#__PURE__*/React.createElement("div", {
41
- className: classNames("".concat(prefixCls, "-fake-checked"))
42
- }, /*#__PURE__*/React.createElement(CheckOutline, null)) : /*#__PURE__*/React.createElement("div", {
43
- className: classNames("".concat(prefixCls, "-fake-unchecked"))
44
- }))), /*#__PURE__*/React.createElement("div", {
45
- className: classNames("".concat(prefixCls, "-content"))
46
- }, children));
48
+ };
49
+ if (shape === 'round') {
50
+ return /*#__PURE__*/React.createElement(CheckboxRound, _extends({}, rest, {
51
+ checked: innerChecked,
52
+ onClick: handleClick
53
+ }));
54
+ }
55
+ if (shape === 'button') {
56
+ return /*#__PURE__*/React.createElement(CheckboxButton, _extends({}, rest, {
57
+ checked: innerChecked,
58
+ onClick: handleClick
59
+ }));
60
+ }
61
+ return null;
47
62
  };
@@ -1,10 +1,8 @@
1
1
  import { Checkbox as InternalCheckbox } from "./checkbox";
2
2
  import { CheckboxGroup } from './checkbox-group';
3
- import { CheckboxButton } from './checkbox-button';
4
3
  import { CheckboxProps } from "./types";
5
4
  type CompoundedComponent = typeof InternalCheckbox & {
6
5
  Group: typeof CheckboxGroup;
7
- Button: typeof CheckboxButton;
8
6
  };
9
7
  declare const Checkbox: CompoundedComponent;
10
8
  export type { CheckboxProps };
@@ -1,7 +1,5 @@
1
1
  import { Checkbox as InternalCheckbox } from "./checkbox";
2
2
  import { CheckboxGroup } from "./checkbox-group";
3
- import { CheckboxButton } from "./checkbox-button";
4
3
  var Checkbox = InternalCheckbox;
5
4
  Checkbox.Group = CheckboxGroup;
6
- Checkbox.Button = CheckboxButton;
7
5
  export default Checkbox;
@@ -1,151 +1,165 @@
1
- @use "../style/variable" as *;
2
- $checkboxCls: 'triones-antm-checkbox';
3
-
4
- $checkboxDisabledColor:rgba(0,0,0,0.25) !default;
5
-
6
- .#{$checkboxCls}-wrapper{
7
- display: flex;
8
- align-items: center;
9
- box-sizing: border-box;
10
- gap: 8Px;
11
- .#{$checkboxCls}{
12
- position: relative;
13
- &-input{
14
- cursor: inherit;
15
- position: absolute;
16
- opacity: 0;
17
- width: 100%;
18
- height: 100%;
19
- top: 0;
20
- left: 0;
21
- margin: 0;
22
- padding: 0;
23
- z-index: 1;
24
- }
25
- &-fake{
26
- width: 22PX;
27
- height: 22PX;
28
- .triones-antm-icon{
29
- //position: absolute;
30
- }
31
- &-checked{
32
- height: 100%;
33
- width: 100%;
34
- display: inline-flex;
35
- justify-content: center;
36
- align-items: center;
37
- background-color: $trionesColorPrimary;
38
- color: white;
39
- border-radius: 50vh;
40
- box-sizing: border-box;
41
- overflow: hidden;
42
- //i{
43
- // width: 100%;
44
- // height: 100%;
45
- // display: flex;
46
- // align-items: center;
47
- // justify-content: center;
48
- //}
49
- }
50
- &-unchecked{
51
- height: 100%;
52
- width: 100%;
53
- display: inline-flex;
54
- justify-content: center;
55
- align-items: center;
56
- border-radius: 50vh;
57
- border: 1PX solid $trionesBorderColor;
58
- box-sizing: border-box;
59
- }
60
- }
61
- }
62
-
63
-
64
- &.#{$checkboxCls}-disabled{
65
- color: $checkboxDisabledColor;
66
- pointer-events: none;
67
- .#{$checkboxCls}-fake-checked{
68
- background-color: $checkboxDisabledColor;
69
- }
70
- }
71
-
72
- .triones-antm-icon {
73
- //position: absolute;
74
- }
75
- }
76
-
77
-
78
-
79
- .#{$checkboxCls}-group{
80
- display: flex;
81
- }
82
-
83
- .#{$checkboxCls}-button{
84
- cursor: pointer;
85
- display: inline-flex;
86
- padding: 4Px 12Px;
87
- border-radius: 8Px;
88
- position: relative;
89
- overflow: hidden;
90
- background-color: #f6f6f6;
91
- box-sizing: border-box;
92
-
93
- &-checked {
94
- background-color: #ffffff;
95
- border: 1Px solid #1677ff;
96
-
97
- .#{$checkboxCls}-button-content {
98
- color: #1677ff;
99
- }
100
- }
101
-
102
- &-disabled {
103
- pointer-events: none;
104
- color: $checkboxDisabledColor;
105
- &.#{$checkboxCls}-button {
106
- &-checked{
107
- border: 1Px solid $checkboxDisabledColor;
108
- .#{$checkboxCls}-button-content {
109
- color: $checkboxDisabledColor;
110
- }
111
- }
112
- .#{$checkboxCls}-button-icon{
113
- border-bottom: 10Px solid $checkboxDisabledColor;
114
- border-right: 10Px solid $checkboxDisabledColor;
115
- }
116
- }
117
-
118
- }
119
-
120
-
121
- &-icon {
122
- align-items: flex-end;
123
- border-bottom: 10Px solid $trionesColorPrimary;
124
- border-left: 10Px solid transparent;
125
- border-right: 10Px solid $trionesColorPrimary;
126
- border-top: 10Px solid transparent;
127
- bottom: 0;
128
- display: flex;
129
- height: 0;
130
- justify-content: flex-end;
131
- position: absolute;
132
- right: 0;
133
- width: 0;
134
-
135
- .checkedIcon {
136
- font-size: 6Px;
137
- position: absolute;
138
- left: 50%;
139
- top: 50%;
140
- transform: translate(1Px, -1Px);
141
- //font-family: "triones-ant-mini-icon" !important;
142
- font-style: normal;
143
- color: #ffffff;
144
-
145
- &::before {
146
- font-style: normal;
147
- //content: "\e75f";
148
- }
149
- }
150
- }
151
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $checkboxCls: 'triones-antm-checkbox';
4
+
5
+ $checkboxDisabledColor: rgba(0, 0, 0, 0.25) !default;
6
+
7
+ .#{$checkboxCls}-group {
8
+
9
+ }
10
+
11
+ .#{$checkboxCls}-round {
12
+ display: flex;
13
+ align-items: center;
14
+ box-sizing: border-box;
15
+ gap: 8Px;
16
+
17
+ .#{$checkboxCls}-round {
18
+ position: relative;
19
+
20
+ &-input {
21
+ cursor: inherit;
22
+ position: absolute;
23
+ opacity: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ top: 0;
27
+ left: 0;
28
+ margin: 0;
29
+ padding: 0;
30
+ z-index: 1;
31
+ }
32
+
33
+ &-fake {
34
+ width: 20PX;
35
+ height: 20PX;
36
+
37
+ .triones-antm-icon {
38
+ //position: absolute;
39
+ }
40
+
41
+ &-checked {
42
+ height: 100%;
43
+ width: 100%;
44
+ display: inline-flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ background-color: variable.$trionesColorPrimary;
48
+ color: white;
49
+ border-radius: 50vh;
50
+ box-sizing: border-box;
51
+ overflow: hidden;
52
+ .triones-antm-icon{
53
+ font-size: 14Px;
54
+ }
55
+ //i{
56
+ // width: 100%;
57
+ // height: 100%;
58
+ // display: flex;
59
+ // align-items: center;
60
+ // justify-content: center;
61
+ //}
62
+ }
63
+
64
+ &-unchecked {
65
+ height: 100%;
66
+ width: 100%;
67
+ display: inline-flex;
68
+ justify-content: center;
69
+ align-items: center;
70
+ border-radius: 50vh;
71
+ border: 1PX solid variable.$trionesBorderColor;
72
+ box-sizing: border-box;
73
+ }
74
+ }
75
+ }
76
+
77
+
78
+ &.#{$checkboxCls}-disabled {
79
+ color: $checkboxDisabledColor;
80
+ pointer-events: none;
81
+
82
+ .#{$checkboxCls}-fake-checked {
83
+ background-color: $checkboxDisabledColor;
84
+ }
85
+ }
86
+
87
+ .triones-antm-icon {
88
+ //position: absolute;
89
+ }
90
+ }
91
+
92
+
93
+ .#{$checkboxCls}-button {
94
+ cursor: pointer;
95
+ display: inline-flex;
96
+ padding: 4Px 12Px;
97
+ border-radius: variable.$trionesBorderRadius;
98
+ position: relative;
99
+ overflow: hidden;
100
+ background-color: variable.$trionesColorFillSecondary;
101
+ box-sizing: border-box;
102
+ border: 1Px solid variable.$trionesColorFillSecondary;
103
+
104
+ &-checked {
105
+ background-color: #ffffff;
106
+ border: 1Px solid variable.$trionesColorPrimary;
107
+
108
+ .#{$checkboxCls}-button-content {
109
+ color: variable.$trionesColorPrimary;
110
+ }
111
+ }
112
+
113
+ &-disabled {
114
+ pointer-events: none;
115
+ color: $checkboxDisabledColor;
116
+
117
+ &.#{$checkboxCls}-button {
118
+ &-checked {
119
+ border: 1Px solid $checkboxDisabledColor;
120
+
121
+ .#{$checkboxCls}-button-content {
122
+ color: $checkboxDisabledColor;
123
+ }
124
+ }
125
+
126
+ .#{$checkboxCls}-button-icon {
127
+ border-bottom: 10Px solid $checkboxDisabledColor;
128
+ border-right: 10Px solid $checkboxDisabledColor;
129
+ }
130
+ }
131
+
132
+ }
133
+
134
+
135
+ &-icon {
136
+ align-items: flex-end;
137
+ border-bottom: 10Px solid variable.$trionesColorPrimary;
138
+ border-left: 10Px solid transparent;
139
+ border-right: 10Px solid variable.$trionesColorPrimary;
140
+ border-top: 10Px solid transparent;
141
+ bottom: 0;
142
+ display: flex;
143
+ height: 0;
144
+ justify-content: flex-end;
145
+ position: absolute;
146
+ right: 0;
147
+ width: 0;
148
+
149
+ .checkedIcon {
150
+ font-size: 6Px;
151
+ position: absolute;
152
+ left: 50%;
153
+ top: 50%;
154
+ transform: translate(1Px, -1Px);
155
+ //font-family: "triones-ant-mini-icon" !important;
156
+ font-style: normal;
157
+ color: #ffffff;
158
+
159
+ &::before {
160
+ font-style: normal;
161
+ //content: "\e75f";
162
+ }
163
+ }
164
+ }
165
+ }
@@ -1,14 +1,23 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  export declare const cls = "triones-antm-checkbox";
3
3
  export type CheckboxGroupContextType = {
4
+ group?: boolean;
5
+ value?: any;
6
+ onValueChange?: (v: any) => void;
7
+ };
8
+ export type Shape = 'button' | 'round';
9
+ export type CheckboxOptionProps = {
10
+ label?: ReactNode;
4
11
  value?: any;
5
- handleCheck?: (v: any) => void;
6
12
  };
7
13
  export type CheckboxGroupProps = {
8
14
  value?: any[];
9
15
  defaultValue?: any[];
10
16
  onChange?: (v: any[]) => void;
11
17
  children?: ReactNode;
18
+ shape?: Shape;
19
+ options?: CheckboxOptionProps[];
20
+ direction?: 'horizontal' | 'vertical';
12
21
  };
13
22
  export type CheckboxProps = {
14
23
  children?: React.ReactNode;
@@ -17,4 +26,5 @@ export type CheckboxProps = {
17
26
  value?: any;
18
27
  disabled?: boolean;
19
28
  onChange?: (e: any) => void;
29
+ shape?: Shape;
20
30
  };
@@ -15,6 +15,7 @@ type Config = {
15
15
  };
16
16
  form?: {
17
17
  helpIcon?: ReactNode;
18
+ arrowIcon?: ReactNode;
18
19
  };
19
20
  input?: {
20
21
  clearIcon?: ReactNode;
@@ -1,20 +1,20 @@
1
- .demoBlock {
2
- font-size: 14px;
3
- margin-bottom: 12px;
4
- &:last-of-type {
5
- padding-bottom: 32px;
6
- }
7
- scrollbar-width: thin;
8
- }
9
-
10
- .demoTitle {
11
- padding: 12px 12px 8px;
12
- color: #697b8c;
13
- font-size: 14px;
14
- background: #fafbfc;
15
- }
16
-
17
- .demoMain {
18
- border-right: none;
19
- border-left: none;
20
- }
1
+ .demoBlock {
2
+ font-size: 14px;
3
+ margin-bottom: 12px;
4
+ &:last-of-type {
5
+ padding-bottom: 32px;
6
+ }
7
+ scrollbar-width: thin;
8
+ }
9
+
10
+ .demoTitle {
11
+ padding: 12px 12px 8px;
12
+ color: #697b8c;
13
+ font-size: 14px;
14
+ background: #fafbfc;
15
+ }
16
+
17
+ .demoMain {
18
+ border-right: none;
19
+ border-left: none;
20
+ }
@@ -1,3 +1,3 @@
1
- .demoDescription {
2
- color: var(--triones-antm-color-weak);
3
- }
1
+ .demoDescription {
2
+ color: var(--triones-antm-color-weak);
3
+ }
@@ -1,65 +1,65 @@
1
- @use "../style/variable" as *;
2
-
3
- $descriptionsCls: 'triones-antm-descriptions';
4
- .#{$descriptionsCls} {
5
- &-header {
6
- }
7
-
8
- &-view {
9
- display: grid;
10
-
11
- .#{$descriptionsCls} {
12
- &-row {
13
- display: flex;
14
- }
15
-
16
- &-item {
17
- display: flex;
18
- align-items: center;
19
- padding: 4Px 4Px;
20
- overflow: hidden;
21
- &-label {
22
- color: $trionesColorTextSecondary;
23
- word-wrap: break-word; /* 允许长单词或URL换行 */
24
- overflow-wrap: break-word; /* 更标准的属性名 */
25
- white-space: normal; /* 默认换行行为 */
26
- flex-shrink: 0;
27
- }
28
-
29
- &-content {
30
- word-wrap: break-word; /* 允许长单词或URL换行 */
31
- overflow-wrap: break-word; /* 更标准的属性名 */
32
- white-space: normal; /* 默认换行行为 */
33
- flex: 1 auto;
34
- min-width: 0;
35
- }
36
- }
37
- }
38
- }
39
-
40
- &-bordered {
41
- border: 1Px solid $trionesBorderColor;
42
- border-radius: $trionesBorderRadius;
43
- overflow: hidden;
44
-
45
- .#{$descriptionsCls} {
46
- &-view{
47
- background-color: rgba(5,5,5,0.06);
48
- grid-gap: 1Px;
49
- }
50
- &-item {
51
- &-label {
52
- display: flex;
53
- background-color: rgb(250, 250, 250);
54
- align-items: center;
55
- padding: 4Px 4Px;
56
- }
57
- &-content {
58
- background-color: white;
59
- padding: 4Px 4Px;
60
- }
61
- }
62
- }
63
-
64
- }
65
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $descriptionsCls: 'triones-antm-descriptions';
4
+ .#{$descriptionsCls} {
5
+ &-header {
6
+ }
7
+
8
+ &-view {
9
+ display: grid;
10
+
11
+ .#{$descriptionsCls} {
12
+ &-row {
13
+ display: flex;
14
+ }
15
+
16
+ &-item {
17
+ display: flex;
18
+ align-items: center;
19
+ padding: 4Px 4Px;
20
+ overflow: hidden;
21
+ &-label {
22
+ color: variable.$trionesColorTextSecondary;
23
+ word-wrap: break-word; /* 允许长单词或URL换行 */
24
+ overflow-wrap: break-word; /* 更标准的属性名 */
25
+ white-space: normal; /* 默认换行行为 */
26
+ flex-shrink: 0;
27
+ }
28
+
29
+ &-content {
30
+ word-wrap: break-word; /* 允许长单词或URL换行 */
31
+ overflow-wrap: break-word; /* 更标准的属性名 */
32
+ white-space: normal; /* 默认换行行为 */
33
+ flex: 1 auto;
34
+ min-width: 0;
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ &-bordered {
41
+ border: 1Px solid variable.$trionesBorderColor;
42
+ border-radius: variable.$trionesBorderRadius;
43
+ overflow: hidden;
44
+
45
+ .#{$descriptionsCls} {
46
+ &-view{
47
+ background-color: rgba(5,5,5,0.06);
48
+ grid-gap: 1Px;
49
+ }
50
+ &-item {
51
+ &-label {
52
+ display: flex;
53
+ background-color: rgb(250, 250, 250);
54
+ align-items: center;
55
+ padding: 4Px 4Px;
56
+ }
57
+ &-content {
58
+ background-color: white;
59
+ padding: 4Px 4Px;
60
+ }
61
+ }
62
+ }
63
+
64
+ }
65
+ }