@trionesdev/antd-mobile-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 (262) 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/Avatar/demo/base.js +2 -2
  8. package/dist/Avatar/demo/style.scss +6 -6
  9. package/dist/Badge/demo/base.js +2 -2
  10. package/dist/Badge/demo/base.scss +6 -6
  11. package/dist/Button/button.d.ts +2 -1
  12. package/dist/Button/button.js +1 -1
  13. package/dist/Button/demo/base.js +2 -2
  14. package/dist/Button/style.scss +234 -232
  15. package/dist/Calendar/calendar-grid.d.ts +10 -9
  16. package/dist/Calendar/calendar-grid.js +41 -64
  17. package/dist/Calendar/calendar-header.d.ts +3 -2
  18. package/dist/Calendar/calendar-header.js +6 -6
  19. package/dist/Calendar/calendar-range.d.ts +4 -3
  20. package/dist/Calendar/calendar-range.js +12 -11
  21. package/dist/Calendar/calendar.d.ts +5 -4
  22. package/dist/Calendar/calendar.js +23 -14
  23. package/dist/Calendar/style.scss +85 -85
  24. package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
  25. package/dist/Calendar/touchable-calendar-grid.js +67 -59
  26. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
  27. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +14 -28
  28. package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
  29. package/dist/CalendarDatetimePicker/DateTimeSwitch.js +4 -3
  30. package/dist/CalendarDatetimePicker/demo/base.js +1 -1
  31. package/dist/CalendarDatetimePicker/style.scss +54 -54
  32. package/dist/CalendarDatetimePicker/types.d.ts +1 -1
  33. package/dist/CalendarDatetimePicker/types.js +1 -1
  34. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +11 -0
  35. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +61 -0
  36. package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.js +9 -15
  37. package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
  38. package/dist/CalendarDatetimePickerCell/index.js +2 -0
  39. package/dist/CalendarDatetimePickerCell/style.scss +10 -0
  40. package/dist/CalendarDatetimePickerCell/types.d.ts +1 -0
  41. package/dist/CalendarDatetimePickerCell/types.js +1 -0
  42. package/dist/CalendarPicker/calendar-picker.js +2 -2
  43. package/dist/CalendarPicker/calendar-range-picker.d.ts +4 -4
  44. package/dist/CalendarPicker/calendar-range-picker.js +11 -9
  45. package/dist/CalendarPicker/demo/base.js +6 -6
  46. package/dist/CalendarPicker/index.d.ts +2 -2
  47. package/dist/CalendarPicker/index.js +3 -3
  48. package/dist/CalendarPicker/style.scss +31 -31
  49. package/dist/CalendarPicker/types.d.ts +8 -7
  50. package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
  51. package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
  52. package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
  53. package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
  54. package/dist/CalendarPickerCell/demo/base.d.ts +3 -0
  55. package/dist/CalendarPickerCell/demo/base.js +31 -0
  56. package/dist/CalendarPickerCell/index.d.ts +8 -0
  57. package/dist/CalendarPickerCell/index.js +5 -0
  58. package/dist/Card/demo/base.js +2 -2
  59. package/dist/Card/demo/base.scss +18 -18
  60. package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
  61. package/dist/CascaderPicker/cascader-picker.js +90 -0
  62. package/dist/CascaderPicker/demo/base.js +1 -4
  63. package/dist/CascaderPicker/index.d.ts +1 -1
  64. package/dist/CascaderPicker/index.js +1 -1
  65. package/dist/CascaderPicker/style.scss +45 -0
  66. package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +21 -0
  67. package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
  68. package/dist/CascaderPickerCell/demo/base.js +71 -0
  69. package/dist/CascaderPickerCell/index.d.ts +3 -0
  70. package/dist/CascaderPickerCell/index.js +2 -0
  71. package/dist/CascaderPickerCell/style.scss +24 -0
  72. package/dist/Cell/demo/base.js +41 -2
  73. package/dist/Checkbox/demo/base.js +11 -6
  74. package/dist/Checkbox/demo/disabled.js +2 -1
  75. package/dist/ConfigProvider/demo/base.js +2 -2
  76. package/dist/DemoBlock/index.d.ts +6 -0
  77. package/dist/DemoBlock/index.js +9 -2
  78. package/dist/DemoBlock/index.scss +20 -20
  79. package/dist/DemoDescription/index.scss +3 -3
  80. package/dist/Divider/demo/base.js +2 -2
  81. package/dist/Ellipsis/demo/base.js +2 -2
  82. package/dist/Empty/demo/base.js +2 -2
  83. package/dist/ErrorBlock/demo/base.js +2 -2
  84. package/dist/FetchPicker/FetchPicker.d.ts +113 -0
  85. package/dist/FetchPicker/FetchPicker.js +319 -0
  86. package/dist/FetchPicker/index.d.ts +4 -0
  87. package/dist/FetchPicker/index.js +3 -0
  88. package/dist/FetchPicker/styles.scss +118 -0
  89. package/dist/FloatButton/FloatButton.d.ts +21 -0
  90. package/dist/FloatButton/FloatButton.js +66 -0
  91. package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
  92. package/dist/FloatButton/FloatButtonGroup.js +120 -0
  93. package/dist/FloatButton/context.d.ts +13 -0
  94. package/dist/FloatButton/context.js +2 -0
  95. package/dist/FloatButton/demo/base.d.ts +3 -0
  96. package/dist/FloatButton/demo/base.js +10 -0
  97. package/dist/FloatButton/demo/group.d.ts +3 -0
  98. package/dist/FloatButton/demo/group.js +20 -0
  99. package/dist/FloatButton/demo/square.d.ts +3 -0
  100. package/dist/FloatButton/demo/square.js +12 -0
  101. package/dist/FloatButton/index.d.ts +10 -0
  102. package/dist/FloatButton/index.js +5 -0
  103. package/dist/FloatButton/style.scss +123 -0
  104. package/dist/Footer/demo/base.js +2 -2
  105. package/dist/Form/FormItem/form-item-content.d.ts +17 -0
  106. package/dist/Form/FormItem/form-item-content.js +39 -0
  107. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  108. package/dist/Form/FormItem/form-item-label.js +29 -0
  109. package/dist/Form/FormItem/form-item.d.ts +51 -0
  110. package/dist/Form/FormItem/form-item.js +74 -0
  111. package/dist/Form/FormItem/index.d.ts +5 -0
  112. package/dist/Form/FormItem/index.js +3 -0
  113. package/dist/Form/demo/input.js +7 -3
  114. package/dist/Form/demo/vertical.d.ts +3 -0
  115. package/dist/Form/demo/vertical.js +45 -0
  116. package/dist/Form/index.d.ts +9 -2
  117. package/dist/Form/index.js +5 -1
  118. package/dist/Form/style.scss +106 -0
  119. package/dist/FormCell/index.d.ts +3 -0
  120. package/dist/FormCell/index.js +2 -0
  121. package/dist/Grid/demo/base.js +2 -2
  122. package/dist/Grid/demo/base.scss +7 -7
  123. package/dist/Icon/demo/base.js +2 -2
  124. package/dist/Image/demo/base.js +2 -2
  125. package/dist/Image/demo/base.scss +4 -4
  126. package/dist/Image/style.scss +30 -30
  127. package/dist/ImagesPreview/ImagesPreview.js +2 -2
  128. package/dist/ImagesPreview/style.scss +34 -34
  129. package/dist/ImagesWall/CameraModal.js +2 -2
  130. package/dist/ImagesWall/style.scss +70 -70
  131. package/dist/Input/base-input.d.ts +13 -0
  132. package/dist/Input/base-input.js +41 -0
  133. package/dist/Input/demo/base.js +115 -13
  134. package/dist/Input/index.d.ts +14 -2
  135. package/dist/Input/index.js +11 -1
  136. package/dist/Input/index.scss +240 -0
  137. package/dist/Input/input-affix-wrapper.d.ts +13 -0
  138. package/dist/Input/input-affix-wrapper.js +37 -0
  139. package/dist/Input/input-opt.d.ts +16 -0
  140. package/dist/Input/input-opt.js +87 -0
  141. package/dist/Input/input-password.d.ts +7 -0
  142. package/dist/Input/input-password.js +48 -0
  143. package/dist/Input/input.d.ts +20 -0
  144. package/dist/Input/input.js +66 -0
  145. package/dist/Input/textarea.d.ts +15 -0
  146. package/dist/Input/textarea.js +51 -0
  147. package/dist/Input/types.d.ts +3 -0
  148. package/dist/Input/types.js +2 -0
  149. package/dist/Loading/DotLoading.d.ts +1 -0
  150. package/dist/Loading/DotLoading.js +1 -0
  151. package/dist/Loading/SpinLoading.d.ts +1 -0
  152. package/dist/Loading/SpinLoading.js +1 -0
  153. package/dist/Loading/demo/base.d.ts +3 -0
  154. package/dist/{SpinLoading → Loading}/demo/base.js +8 -2
  155. package/dist/Loading/demo/dot-loading.d.ts +3 -0
  156. package/dist/Loading/demo/dot-loading.js +25 -0
  157. package/dist/Loading/index.d.ts +5 -0
  158. package/dist/Loading/index.js +3 -0
  159. package/dist/NavBar/demo/base.scss +5 -5
  160. package/dist/NoticeBar/demo/base.js +2 -2
  161. package/dist/Overlay/Overlay.d.ts +16 -0
  162. package/dist/Overlay/Overlay.js +117 -0
  163. package/dist/Overlay/demo/base.d.ts +3 -0
  164. package/dist/Overlay/demo/base.js +27 -0
  165. package/dist/Overlay/index.d.ts +4 -0
  166. package/dist/Overlay/index.js +3 -0
  167. package/dist/Overlay/style.scss +20 -0
  168. package/dist/PageIndicator/demo/base.js +2 -2
  169. package/dist/Picker/index.d.ts +1 -1
  170. package/dist/Picker/index.js +1 -1
  171. package/dist/Picker/picker.d.ts +20 -0
  172. package/dist/Picker/picker.js +94 -0
  173. package/dist/Picker/style.scss +44 -0
  174. package/dist/PickerView/index.d.ts +2 -1
  175. package/dist/PickerView/index.js +1 -1
  176. package/dist/PickerView/picker-view-column-item.d.ts +7 -0
  177. package/dist/PickerView/picker-view-column-item.js +11 -0
  178. package/dist/PickerView/picker-view-column.d.ts +10 -0
  179. package/dist/PickerView/picker-view-column.js +117 -0
  180. package/dist/PickerView/picker-view.d.ts +12 -0
  181. package/dist/PickerView/picker-view.js +60 -0
  182. package/dist/PickerView/style.scss +72 -0
  183. package/dist/PickerView/types.d.ts +4 -0
  184. package/dist/PickerView/types.js +1 -0
  185. package/dist/Popup/demo/base.js +109 -27
  186. package/dist/Popup/index.d.ts +2 -1
  187. package/dist/Popup/index.js +2 -1
  188. package/dist/Popup/popup.d.ts +31 -0
  189. package/dist/Popup/popup.js +87 -0
  190. package/dist/Popup/style.scss +129 -0
  191. package/dist/Progress/index.d.ts +1 -1
  192. package/dist/Progress/index.js +1 -1
  193. package/dist/Radio/demo/base.js +2 -2
  194. package/dist/Radio/demo/base.scss +4 -4
  195. package/dist/Result/demo/base.js +2 -2
  196. package/dist/SafeArea/demo/base.scss +18 -18
  197. package/dist/ScrollView/index.d.ts +2 -1
  198. package/dist/ScrollView/index.js +1 -1
  199. package/dist/ScrollView/scroll-view.d.ts +4 -0
  200. package/dist/ScrollView/scroll-view.js +55 -0
  201. package/dist/ScrollView/style.scss +19 -0
  202. package/dist/ScrollView/types.d.ts +26 -0
  203. package/dist/ScrollView/types.js +1 -0
  204. package/dist/Segmented/demo/base.d.ts +3 -0
  205. package/dist/Segmented/demo/base.js +33 -0
  206. package/dist/Segmented/index.d.ts +3 -0
  207. package/dist/Segmented/index.js +2 -0
  208. package/dist/SideBar/index.d.ts +1 -1
  209. package/dist/SideBar/side-bar.js +6 -6
  210. package/dist/SideBar/style.scss +85 -85
  211. package/dist/Skeleton/demo/base.d.ts +3 -0
  212. package/dist/Skeleton/demo/base.js +8 -0
  213. package/dist/Skeleton/index.d.ts +3 -0
  214. package/dist/Skeleton/index.js +2 -0
  215. package/dist/Space/demo/base.js +2 -2
  216. package/dist/Stepper/demo/base.d.ts +3 -0
  217. package/dist/Stepper/demo/base.js +23 -0
  218. package/dist/Stepper/index.d.ts +3 -0
  219. package/dist/Stepper/index.js +2 -0
  220. package/dist/Swiper/style.scss +54 -54
  221. package/dist/Switch/demo/base.js +2 -2
  222. package/dist/TabBar/demo/base.js +2 -2
  223. package/dist/Tag/demo/base.js +2 -2
  224. package/dist/Tag/demo/style.scss +8 -8
  225. package/dist/Toast/style.scss +63 -63
  226. package/dist/Toast/toast-modal.js +4 -4
  227. package/dist/VerificationCodeInput/demo/base.js +2 -2
  228. package/dist/VerificationCodeInput/index.d.ts +2 -2
  229. package/dist/VerificationCodeInput/index.js +1 -1
  230. package/dist/VerificationCodeInput/style.scss +20 -0
  231. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  232. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  233. package/dist/WaterMark/demo/demo1.js +2 -2
  234. package/dist/WaterMark/demo/demo1.scss +6 -6
  235. package/dist/WaterMark/demo/demo2.js +2 -2
  236. package/dist/index.d.ts +33 -19
  237. package/dist/index.js +9 -2
  238. package/dist/style/variable.scss +1 -1
  239. package/dist/types.d.ts +0 -8
  240. package/dist/types.js +0 -1
  241. package/dist/utils/dayjs.d.ts +4 -0
  242. package/dist/utils/dayjs.js +42 -0
  243. package/dist/utils/type.js +36 -36
  244. package/dist/utils/use-isomorphic-update-layout-effect.d.ts +1 -1
  245. package/dist/utils/with-default-props.js +4 -4
  246. package/package.json +11 -16
  247. package/readme.md +43 -43
  248. package/dist/Mask/index.d.ts +0 -3
  249. package/dist/Mask/index.js +0 -2
  250. package/dist/Progress/Progress.d.ts +0 -37
  251. package/dist/Progress/Progress.js +0 -52
  252. package/dist/Progress/ProgressCircle.d.ts +0 -17
  253. package/dist/Progress/ProgressCircle.js +0 -148
  254. package/dist/Progress/ProgressLine.d.ts +0 -15
  255. package/dist/Progress/ProgressLine.js +0 -87
  256. package/dist/Progress/style.scss +0 -33
  257. package/dist/Progress/types.d.ts +0 -4
  258. package/dist/Progress/types.js +0 -2
  259. package/dist/SpinLoading/index.d.ts +0 -3
  260. package/dist/SpinLoading/index.js +0 -2
  261. /package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.d.ts +0 -0
  262. /package/dist/{SpinLoading → CascaderPickerCell}/demo/base.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ import CalendarDatetimePickerCell, { CalendarDatetimePickerCellProps } from "./CalendarDatetimePickerCell";
2
+ export type { CalendarDatetimePickerCellProps };
3
+ export default CalendarDatetimePickerCell;
@@ -0,0 +1,2 @@
1
+ import CalendarDatetimePickerCell from "./CalendarDatetimePickerCell";
2
+ export default CalendarDatetimePickerCell;
@@ -0,0 +1,10 @@
1
+ @use "../style/variable" as variable;
2
+ $calendarDatetimePickerCls: 'triones-antm-calendar-datetime-picker';
3
+
4
+ .#{$calendarDatetimePickerCls}{
5
+ min-width: 50Px;
6
+ line-height: 1.4;
7
+ &-placeholder{
8
+ color: variable.$trionesColorTextPlaceholder;
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ export declare const cls = "triones-antm-calendar-datetime-picker";
@@ -0,0 +1 @@
1
+ export var cls = 'triones-antm-calendar-datetime-picker';
@@ -12,7 +12,7 @@ import ConfigProvider from "../ConfigProvider";
12
12
  import Popup from "../Popup";
13
13
  var cls = 'triones-antm-calendar-picker';
14
14
  export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
15
- var mouth = _ref.mouth,
15
+ var month = _ref.month,
16
16
  open = _ref.open,
17
17
  title = _ref.title,
18
18
  afterOpenChange = _ref.afterOpenChange,
@@ -78,7 +78,7 @@ export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
78
78
  }, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
79
79
  className: classNames("".concat(cls, "-body"))
80
80
  }, /*#__PURE__*/React.createElement(Calendar, {
81
- mouth: mouth,
81
+ month: month,
82
82
  value: value,
83
83
  onChange: function onChange(date) {
84
84
  valueRef.current = date;
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
2
- import "./style.scss";
3
- import { CalendarPickerRangeProps } from "./types";
4
- export declare const CalendarRangePicker: FC<CalendarPickerRangeProps>;
1
+ import { FC } from 'react';
2
+ import './style.scss';
3
+ import { CalendarRangePickerProps } from './types';
4
+ export declare const CalendarRangePicker: FC<CalendarRangePickerProps>;
@@ -4,15 +4,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  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; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { memo, useEffect, useRef } from "react";
8
- import Popup from "../Popup";
9
- import classNames from "classnames";
7
+ import classNames from 'classnames';
8
+ import React, { memo, useEffect, useRef } from 'react';
10
9
  import Calendar from "../Calendar";
11
- import "./style.scss";
12
10
  import ConfigProvider from "../ConfigProvider";
11
+ import Popup from "../Popup";
12
+ import "./style.scss";
13
+ import { isSameArray, toDayjsArray } from "../utils/dayjs";
13
14
  var cls = 'triones-antm-calendar-picker';
14
15
  export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
15
- var mouth = _ref.mouth,
16
+ var month = _ref.month,
16
17
  open = _ref.open,
17
18
  title = _ref.title,
18
19
  afterOpenChange = _ref.afterOpenChange,
@@ -44,8 +45,8 @@ export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
44
45
  }, [innerOpen]);
45
46
  useEffect(function () {
46
47
  if (value !== undefined) {
47
- if (value !== valueRef.current) {
48
- valueRef.current = value;
48
+ if (!isSameArray(value, valueRef.current, 'day')) {
49
+ valueRef.current = toDayjsArray(value);
49
50
  }
50
51
  }
51
52
  }, [value]);
@@ -62,7 +63,8 @@ export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
62
63
  open: innerOpen,
63
64
  onClose: function onClose() {
64
65
  setInnerOpen(false);
65
- }
66
+ },
67
+ round: true
66
68
  }, /*#__PURE__*/React.createElement("div", {
67
69
  className: classNames("".concat(cls))
68
70
  }, /*#__PURE__*/React.createElement("div", {
@@ -78,7 +80,7 @@ export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
78
80
  }, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
79
81
  className: classNames("".concat(cls, "-body"))
80
82
  }, /*#__PURE__*/React.createElement(Calendar.Range, {
81
- mouth: mouth,
83
+ month: month,
82
84
  value: value,
83
85
  onChange: function onChange(date) {
84
86
  valueRef.current = date;
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React from 'react';
8
8
  import { DemoBlock } from "../../DemoBlock";
9
9
  import Button from "../../Button";
10
- import CalendarPicker from "../index";
10
+ import CalendarPopup from "../index";
11
11
  import Toast from "../../Toast";
12
12
  export default (function () {
13
13
  var toastContainer = React.useRef();
@@ -23,7 +23,7 @@ export default (function () {
23
23
  ref: toastContainer
24
24
  }), /*#__PURE__*/React.createElement(DemoBlock, {
25
25
  title: "\u65E5\u671F\u9009\u62E9\u5668"
26
- }, /*#__PURE__*/React.createElement(CalendarPicker, {
26
+ }, /*#__PURE__*/React.createElement(CalendarPopup, {
27
27
  open: open,
28
28
  afterOpenChange: function afterOpenChange(o) {
29
29
  setOpen(o);
@@ -33,7 +33,7 @@ export default (function () {
33
33
  getContainer: function getContainer() {
34
34
  return toastContainer.current;
35
35
  },
36
- content: "".concat(date.getFullYear(), "-").concat(date.getMonth() + 1, "-").concat(date.getDate())
36
+ content: "".concat(date.year(), "-").concat(date.month() + 1, "-").concat(date.date())
37
37
  });
38
38
  }
39
39
  }), /*#__PURE__*/React.createElement(Button, {
@@ -43,18 +43,18 @@ export default (function () {
43
43
  }
44
44
  }, "\u65E5\u5386\u9009\u62E9\u5668")), /*#__PURE__*/React.createElement(DemoBlock, {
45
45
  title: "\u65E5\u5386\u9009\u62E9\u5668(\u533A\u95F4)"
46
- }, /*#__PURE__*/React.createElement(CalendarPicker.Range, {
46
+ }, /*#__PURE__*/React.createElement(CalendarPopup.Range, {
47
47
  open: open2,
48
48
  afterOpenChange: function afterOpenChange(o) {
49
49
  setOpen2(o);
50
50
  },
51
51
  onOk: function onOk(date) {
52
- var _$getMonth, _$getMonth2;
52
+ var _$month, _$month2;
53
53
  Toast.show({
54
54
  getContainer: function getContainer() {
55
55
  return toastContainer.current;
56
56
  },
57
- content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "".concat(date[0].getFullYear(), "-").concat((_$getMonth = date[0].getMonth()) !== null && _$getMonth !== void 0 ? _$getMonth : +1, "-").concat(date[0].getDate())), /*#__PURE__*/React.createElement("div", null, "".concat(date[1].getFullYear(), "-").concat((_$getMonth2 = date[1].getMonth()) !== null && _$getMonth2 !== void 0 ? _$getMonth2 : +1, "-").concat(date[1].getDate())))
57
+ content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "".concat(date[0].year(), "-").concat((_$month = date[0].month()) !== null && _$month !== void 0 ? _$month : +1, "-").concat(date[0].date())), /*#__PURE__*/React.createElement("div", null, "".concat(date[1].year(), "-").concat((_$month2 = date[1].month()) !== null && _$month2 !== void 0 ? _$month2 : +1, "-").concat(date[1].date())))
58
58
  });
59
59
  }
60
60
  }), /*#__PURE__*/React.createElement(Button, {
@@ -4,6 +4,6 @@ import { CalendarPickerProps } from "./types";
4
4
  type CompoundedComponent = typeof InternalCalendarPicker & {
5
5
  Range: typeof CalendarRangePicker;
6
6
  };
7
- declare const CalendarPicker: CompoundedComponent;
7
+ declare const CalendarPopup: CompoundedComponent;
8
8
  export type { CalendarPickerProps };
9
- export default CalendarPicker;
9
+ export default CalendarPopup;
@@ -1,5 +1,5 @@
1
1
  import { CalendarPicker as InternalCalendarPicker } from "./calendar-picker";
2
2
  import { CalendarRangePicker } from "./calendar-range-picker";
3
- var CalendarPicker = InternalCalendarPicker;
4
- CalendarPicker.Range = CalendarRangePicker;
5
- export default CalendarPicker;
3
+ var CalendarPopup = InternalCalendarPicker;
4
+ CalendarPopup.Range = CalendarRangePicker;
5
+ export default CalendarPopup;
@@ -1,31 +1,31 @@
1
- @use "../style/variable" as *;
2
-
3
- $calendarPickerCls: 'triones-antm-calendar-picker';
4
-
5
- .#{$calendarPickerCls} {
6
- border-top-left-radius: $trionesBorderRadius;
7
- border-top-right-radius: $trionesBorderRadius;
8
-
9
- &-header {
10
- display: flex;
11
- justify-content: space-between;
12
- border-bottom: 1Px solid $trionesBorderColor;
13
- padding: 4Px;
14
- &-button {
15
- padding: 8Px 12Px;
16
-
17
- &-cancel {
18
- }
19
-
20
- &-ok {
21
- color: $trionesColorPrimary;
22
- }
23
- }
24
-
25
-
26
- }
27
-
28
- &-body {
29
- pointer-events: unset;
30
- }
31
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $calendarPickerCls: 'triones-antm-calendar-picker';
4
+
5
+ .#{$calendarPickerCls} {
6
+ border-top-left-radius: variable.$trionesBorderRadius;
7
+ border-top-right-radius: variable.$trionesBorderRadius;
8
+
9
+ &-header {
10
+ display: flex;
11
+ justify-content: space-between;
12
+ border-bottom: 1Px solid variable.$trionesBorderColor;
13
+ padding: 4Px;
14
+ &-button {
15
+ padding: 8Px 12Px;
16
+
17
+ &-cancel {
18
+ }
19
+
20
+ &-ok {
21
+ color: variable.$trionesColorPrimary;
22
+ }
23
+ }
24
+
25
+
26
+ }
27
+
28
+ &-body {
29
+ pointer-events: unset;
30
+ }
31
+ }
@@ -1,21 +1,22 @@
1
1
  import React from "react";
2
+ import dayjs from "dayjs";
2
3
  export type CalendarPickerProps = {
3
- mouth?: Date;
4
+ month?: Date | dayjs.Dayjs;
4
5
  open?: boolean;
5
6
  title?: React.ReactNode;
6
7
  afterOpenChange?: (open: boolean) => void;
7
- value?: Date;
8
- onOk?: (value?: Date) => void;
8
+ value?: Date | dayjs.Dayjs;
9
+ onOk?: (value?: dayjs.Dayjs) => void;
9
10
  onCancel?: () => void;
10
11
  onClose?: () => void;
11
12
  };
12
- export type CalendarPickerRangeProps = {
13
- mouth?: Date;
13
+ export type CalendarRangePickerProps = {
14
+ month?: Date | dayjs.Dayjs;
14
15
  open?: boolean;
15
16
  title?: React.ReactNode;
16
17
  afterOpenChange?: (open: boolean) => void;
17
- value?: Date[];
18
- onOk?: (value?: Date[]) => void;
18
+ value?: (Date | dayjs.Dayjs)[];
19
+ onOk?: (value?: dayjs.Dayjs[]) => void;
19
20
  onCancel?: () => void;
20
21
  onClose?: () => void;
21
22
  };
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { FC } from "react";
3
+ import dayjs from "dayjs";
4
+ import { FormCellProps } from '../FormCell';
5
+ export type CalendarPickerCellProps = Omit<FormCellProps, 'value'> & {
6
+ month?: dayjs.Dayjs | Date;
7
+ title?: React.ReactNode;
8
+ value?: dayjs.Dayjs | Date;
9
+ onChange?: (date?: dayjs.Dayjs) => void;
10
+ };
11
+ export declare const CalendarPickerCell: FC<CalendarPickerCellProps>;
@@ -0,0 +1,54 @@
1
+ var _excluded = ["month", "title", "value", "onChange"];
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ 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."); }
5
+ 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); }
6
+ 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; }
7
+ 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; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ 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; }
10
+ 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; }
11
+ import React, { useState } from "react";
12
+ import dayjs from "dayjs";
13
+ import FormCell from "../FormCell";
14
+ import CalendarPicker from "../CalendarPicker";
15
+ export var CalendarPickerCell = function CalendarPickerCell(_ref) {
16
+ var month = _ref.month,
17
+ title = _ref.title,
18
+ value = _ref.value,
19
+ onChange = _ref.onChange,
20
+ rest = _objectWithoutProperties(_ref, _excluded);
21
+ var _React$useState = React.useState(false),
22
+ _React$useState2 = _slicedToArray(_React$useState, 2),
23
+ innerOpen = _React$useState2[0],
24
+ setInnerOpen = _React$useState2[1];
25
+ var _useState = useState(value ? dayjs(value) : undefined),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ internalValue = _useState2[0],
28
+ setInternalValue = _useState2[1];
29
+ var handleValueRender = function handleValueRender() {
30
+ if (internalValue) {
31
+ return internalValue.format('YYYY-MM-DD');
32
+ }
33
+ return null;
34
+ };
35
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CalendarPicker, {
36
+ month: month,
37
+ value: internalValue,
38
+ open: innerOpen,
39
+ afterOpenChange: function afterOpenChange(o) {
40
+ setInnerOpen(o);
41
+ },
42
+ onClose: function onClose() {
43
+ setInnerOpen(false);
44
+ },
45
+ onOk: function onOk(date) {
46
+ setInternalValue(date);
47
+ onChange === null || onChange === void 0 || onChange(date);
48
+ }
49
+ }), /*#__PURE__*/React.createElement(FormCell, _extends({}, rest, {
50
+ onClick: function onClick() {
51
+ setInnerOpen(true);
52
+ }
53
+ }), handleValueRender()));
54
+ };
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { FC } from "react";
3
+ import dayjs from "dayjs";
4
+ import { FormCellProps } from '../FormCell';
5
+ export type CalendarRangePickerCellProps = Omit<FormCellProps, 'value'> & {
6
+ month?: dayjs.Dayjs;
7
+ title?: React.ReactNode;
8
+ value?: (dayjs.Dayjs | Date)[];
9
+ onChange?: (date?: (dayjs.Dayjs | Date)[]) => void;
10
+ };
11
+ export declare const CalendarRangePickerCell: FC<CalendarRangePickerCellProps>;
@@ -0,0 +1,56 @@
1
+ var _excluded = ["month", "title", "value", "onChange"];
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ 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."); }
5
+ 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); }
6
+ 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; }
7
+ 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; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ 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; }
10
+ 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; }
11
+ import React, { useState } from "react";
12
+ import FormCell from "../FormCell";
13
+ import CalendarPicker from "../CalendarPicker";
14
+ import { toDayjsArray } from "../utils/dayjs";
15
+ export var CalendarRangePickerCell = function CalendarRangePickerCell(_ref) {
16
+ var month = _ref.month,
17
+ title = _ref.title,
18
+ value = _ref.value,
19
+ onChange = _ref.onChange,
20
+ rest = _objectWithoutProperties(_ref, _excluded);
21
+ var _React$useState = React.useState(false),
22
+ _React$useState2 = _slicedToArray(_React$useState, 2),
23
+ innerOpen = _React$useState2[0],
24
+ setInnerOpen = _React$useState2[1];
25
+ var _useState = useState(toDayjsArray(value)),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ internalValue = _useState2[0],
28
+ setInternalValue = _useState2[1];
29
+ var handleValueRender = function handleValueRender() {
30
+ if (internalValue && internalValue.length > 1) {
31
+ return internalValue.map(function (date) {
32
+ return date.format('YYYY-MM-DD');
33
+ }).join(' ~ ');
34
+ }
35
+ return null;
36
+ };
37
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CalendarPicker.Range, {
38
+ month: month,
39
+ value: internalValue,
40
+ open: innerOpen,
41
+ afterOpenChange: function afterOpenChange(o) {
42
+ setInnerOpen(o);
43
+ },
44
+ onClose: function onClose() {
45
+ setInnerOpen(false);
46
+ },
47
+ onOk: function onOk(date) {
48
+ setInternalValue(date);
49
+ onChange === null || onChange === void 0 || onChange(date);
50
+ }
51
+ }), /*#__PURE__*/React.createElement(FormCell, _extends({}, rest, {
52
+ onClick: function onClick() {
53
+ setInnerOpen(true);
54
+ }
55
+ }), handleValueRender()));
56
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
3
+ export default _default;
@@ -0,0 +1,31 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React from 'react';
8
+ import { DemoBlock } from "../../DemoBlock";
9
+ import CalendarPickerCell from "../index";
10
+ export default (function () {
11
+ var toastContainer = React.useRef();
12
+ var _React$useState = React.useState(false),
13
+ _React$useState2 = _slicedToArray(_React$useState, 2),
14
+ open = _React$useState2[0],
15
+ setOpen = _React$useState2[1];
16
+ var _React$useState3 = React.useState(false),
17
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
18
+ open2 = _React$useState4[0],
19
+ setOpen2 = _React$useState4[1];
20
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DemoBlock, {
21
+ title: "\u65E5\u5386\u9009\u62E9"
22
+ }, /*#__PURE__*/React.createElement(CalendarPickerCell, {
23
+ align: "end",
24
+ placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F"
25
+ })), /*#__PURE__*/React.createElement(DemoBlock, {
26
+ title: "\u65E5\u5386\u9009\u62E9(\u533A\u95F4)"
27
+ }, /*#__PURE__*/React.createElement(CalendarPickerCell.Range, {
28
+ align: "end",
29
+ placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F"
30
+ })));
31
+ });
@@ -0,0 +1,8 @@
1
+ import { CalendarPickerCell as InternalCalendarPickerCell, CalendarPickerCellProps } from "./CalendarPickerCell";
2
+ import { CalendarRangePickerCell, CalendarRangePickerCellProps } from "./CalendarRangePickerCell";
3
+ type CompoundedComponent = typeof InternalCalendarPickerCell & {
4
+ Range: typeof CalendarRangePickerCell;
5
+ };
6
+ declare const CalendarPickerCell: CompoundedComponent;
7
+ export type { CalendarPickerCellProps, CalendarRangePickerCellProps };
8
+ export default CalendarPickerCell;
@@ -0,0 +1,5 @@
1
+ import { CalendarPickerCell as InternalCalendarPickerCell } from "./CalendarPickerCell";
2
+ import { CalendarRangePickerCell } from "./CalendarRangePickerCell";
3
+ var CalendarPickerCell = InternalCalendarPickerCell;
4
+ CalendarPickerCell.Range = CalendarRangePickerCell;
5
+ export default CalendarPickerCell;
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
  import classNames from 'classnames';
5
5
  import React from 'react';
@@ -1,18 +1,18 @@
1
- $class-prefix-card: 'card-demo';
2
-
3
- .#{$class-prefix-card} {
4
- &-content {
5
- height: 50px;
6
- }
7
- &-footer {
8
- padding-top: 11px;
9
- border-top: 1px solid #e5e5e5;
10
- display: flex;
11
- justify-content: flex-end;
12
- }
13
-
14
- &-customBody {
15
- color: green;
16
- }
17
-
18
- }
1
+ $class-prefix-card: 'card-demo';
2
+
3
+ .#{$class-prefix-card} {
4
+ &-content {
5
+ height: 50px;
6
+ }
7
+ &-footer {
8
+ padding-top: 11px;
9
+ border-top: 1px solid #e5e5e5;
10
+ display: flex;
11
+ justify-content: flex-end;
12
+ }
13
+
14
+ &-customBody {
15
+ color: green;
16
+ }
17
+
18
+ }
@@ -0,0 +1,27 @@
1
+ import React, { FC } from 'react';
2
+ import './style.scss';
3
+ export type CascaderPickerProps = {
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ open?: boolean;
7
+ afterOpenChange?: (open: boolean) => void;
8
+ title?: React.ReactNode;
9
+ options?: any[];
10
+ /**
11
+ * @description 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 string 变为 { value: string, label: ReactNode } 的格式
12
+ * @default false
13
+ */
14
+ labelInValue?: boolean;
15
+ fieldNames?: {
16
+ value?: string;
17
+ label?: string;
18
+ children?: string;
19
+ };
20
+ columnsCount?: number;
21
+ value?: any[];
22
+ onOk?: (value?: any[]) => void;
23
+ onCancel?: () => void;
24
+ onClose?: () => void;
25
+ asyncRequest?: (parentValue?: any) => Promise<any>;
26
+ };
27
+ export declare const CascaderPicker: FC<CascaderPickerProps>;
@@ -0,0 +1,90 @@
1
+ import classNames from 'classnames';
2
+ import { isEqual } from 'lodash-es';
3
+ import React, { useEffect, useRef } from 'react';
4
+ import CascaderView from "../CascaderView";
5
+ import ConfigProvider from "../ConfigProvider";
6
+ import Popup from "../Popup";
7
+ import "./style.scss";
8
+ var cascaderPickerCls = 'triones-antm-cascader-picker';
9
+ export var CascaderPicker = /*#__PURE__*/React.memo(function (_ref) {
10
+ var className = _ref.className,
11
+ style = _ref.style,
12
+ _ref$open = _ref.open,
13
+ open = _ref$open === void 0 ? false : _ref$open,
14
+ afterOpenChange = _ref.afterOpenChange,
15
+ title = _ref.title,
16
+ options = _ref.options,
17
+ _ref$labelInValue = _ref.labelInValue,
18
+ labelInValue = _ref$labelInValue === void 0 ? false : _ref$labelInValue,
19
+ fieldNames = _ref.fieldNames,
20
+ columnsCount = _ref.columnsCount,
21
+ value = _ref.value,
22
+ onOk = _ref.onOk,
23
+ onCancel = _ref.onCancel,
24
+ onClose = _ref.onClose,
25
+ asyncRequest = _ref.asyncRequest;
26
+ var _ConfigProvider$useCo = ConfigProvider.useConfig(),
27
+ locale = _ConfigProvider$useCo.locale;
28
+ var internalValueRf = useRef(value);
29
+ var handleClose = function handleClose() {
30
+ onClose === null || onClose === void 0 || onClose();
31
+ };
32
+ var handleOk = function handleOk() {
33
+ onOk === null || onOk === void 0 || onOk(internalValueRf.current);
34
+ };
35
+ var handelCancel = function handelCancel() {
36
+ onCancel === null || onCancel === void 0 || onCancel();
37
+ handleClose();
38
+ };
39
+ useEffect(function () {
40
+ if (value === undefined) {
41
+ return;
42
+ }
43
+ if (isEqual(value, internalValueRf.current)) {
44
+ return;
45
+ }
46
+ internalValueRf.current = value;
47
+ }, [value]);
48
+ return /*#__PURE__*/React.createElement(Popup, {
49
+ open: open,
50
+ onClose: handleClose,
51
+ overlayClosable: true,
52
+ round: true,
53
+ styles: {
54
+ body: {
55
+ borderTopLeftRadius: 6,
56
+ borderTopRightRadius: 6
57
+ }
58
+ }
59
+ }, /*#__PURE__*/React.createElement("div", {
60
+ className: classNames(cascaderPickerCls, className),
61
+ style: style
62
+ }, /*#__PURE__*/React.createElement("div", {
63
+ className: classNames("".concat(cascaderPickerCls, "-header"))
64
+ }, /*#__PURE__*/React.createElement("a", {
65
+ className: classNames("".concat(cascaderPickerCls, "-header-button"), "".concat(cascaderPickerCls, "-header-button-cancel")),
66
+ onClick: handelCancel
67
+ }, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
68
+ className: classNames("".concat(cascaderPickerCls, "-header-title"))
69
+ }, title), /*#__PURE__*/React.createElement("a", {
70
+ className: classNames("".concat(cascaderPickerCls, "-header-button"), "".concat(cascaderPickerCls, "-header-button-ok")),
71
+ onClick: handleOk
72
+ }, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
73
+ className: classNames("".concat(cascaderPickerCls, "-body"))
74
+ }, /*#__PURE__*/React.createElement(CascaderView
75
+ // open={ open}
76
+ , {
77
+ fieldNames: fieldNames,
78
+ options: options,
79
+ labelInValue: labelInValue,
80
+ columnsCount: columnsCount,
81
+ value: value,
82
+ onChange: function onChange(newVal) {
83
+ internalValueRf.current = newVal;
84
+ },
85
+ asyncRequest: asyncRequest,
86
+ style: {
87
+ height: '100%'
88
+ }
89
+ }))));
90
+ });