@trionesdev/antd-taro-react 0.0.2-beta.2 → 0.0.2-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/LICENSE +21 -21
  2. package/dist/ActionSheet/ActionSheet.d.ts +25 -0
  3. package/dist/ActionSheet/ActionSheet.js +77 -0
  4. package/dist/ActionSheet/index.d.ts +1 -1
  5. package/dist/ActionSheet/index.js +1 -1
  6. package/dist/ActionSheet/style.scss +52 -0
  7. package/dist/Button/button.d.ts +2 -1
  8. package/dist/Button/button.js +2 -3
  9. package/dist/Button/style.scss +246 -231
  10. package/dist/Calendar/calendar-grid.d.ts +10 -9
  11. package/dist/Calendar/calendar-grid.js +37 -62
  12. package/dist/Calendar/calendar-header.d.ts +3 -2
  13. package/dist/Calendar/calendar-header.js +9 -6
  14. package/dist/Calendar/calendar-range.d.ts +4 -3
  15. package/dist/Calendar/calendar-range.js +22 -18
  16. package/dist/Calendar/calendar.d.ts +5 -4
  17. package/dist/Calendar/calendar.js +30 -17
  18. package/dist/Calendar/style.scss +88 -85
  19. package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
  20. package/dist/Calendar/touchable-calendar-grid.js +96 -95
  21. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
  22. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +40 -57
  23. package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
  24. package/dist/CalendarDatetimePicker/DateTimeSwitch.js +2 -2
  25. package/dist/CalendarDatetimePicker/style.scss +62 -54
  26. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +9 -0
  27. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +60 -0
  28. package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
  29. package/dist/CalendarDatetimePickerCell/index.js +2 -0
  30. package/dist/CalendarPicker/{calendar-picker.js → CalendarPicker.js} +10 -6
  31. package/dist/CalendarPicker/{calendar-range-picker.js → CalendarRangePicker.js} +8 -6
  32. package/dist/CalendarPicker/index.d.ts +3 -4
  33. package/dist/CalendarPicker/index.js +2 -2
  34. package/dist/CalendarPicker/style.scss +32 -31
  35. package/dist/CalendarPicker/types.d.ts +8 -6
  36. package/dist/CalendarPicker/types.js +1 -1
  37. package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
  38. package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
  39. package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
  40. package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
  41. package/dist/CalendarPickerCell/index.d.ts +8 -0
  42. package/dist/CalendarPickerCell/index.js +5 -0
  43. package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
  44. package/dist/CascaderPicker/cascader-picker.js +90 -0
  45. package/dist/CascaderPicker/index.d.ts +1 -1
  46. package/dist/CascaderPicker/index.js +1 -1
  47. package/dist/CascaderPicker/style.scss +45 -0
  48. package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +20 -0
  49. package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
  50. package/dist/CascaderPickerCell/index.d.ts +3 -0
  51. package/dist/CascaderPickerCell/index.js +2 -0
  52. package/dist/DatePicker/DatePicker.d.ts +18 -0
  53. package/dist/DatePicker/DatePicker.js +310 -0
  54. package/dist/DatePicker/index.d.ts +4 -0
  55. package/dist/DatePicker/index.js +3 -0
  56. package/dist/DatePicker/style.scss +41 -0
  57. package/dist/DatePicker/types.d.ts +1 -0
  58. package/dist/DatePicker/types.js +1 -0
  59. package/dist/DatePickerCell/DatePickerCell.d.ts +16 -0
  60. package/dist/DatePickerCell/DatePickerCell.js +78 -0
  61. package/dist/DatePickerCell/index.d.ts +3 -0
  62. package/dist/DatePickerCell/index.js +2 -0
  63. package/dist/FetchPicker/FetchPicker.d.ts +78 -0
  64. package/dist/FetchPicker/FetchPicker.js +310 -0
  65. package/dist/FetchPicker/index.d.ts +4 -0
  66. package/dist/FetchPicker/index.js +3 -0
  67. package/dist/FetchPicker/styles.scss +130 -0
  68. package/dist/FloatButton/FloatButton.d.ts +19 -0
  69. package/dist/FloatButton/FloatButton.js +60 -0
  70. package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
  71. package/dist/FloatButton/FloatButtonGroup.js +141 -0
  72. package/dist/FloatButton/context.d.ts +10 -0
  73. package/dist/FloatButton/context.js +2 -0
  74. package/dist/FloatButton/index.d.ts +10 -0
  75. package/dist/FloatButton/index.js +5 -0
  76. package/dist/FloatButton/style.scss +126 -0
  77. package/dist/Form/FormItem/form-item-content.d.ts +17 -0
  78. package/dist/Form/FormItem/form-item-content.js +39 -0
  79. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  80. package/dist/Form/FormItem/form-item-label.js +29 -0
  81. package/dist/Form/FormItem/form-item.d.ts +23 -0
  82. package/dist/Form/FormItem/form-item.js +77 -0
  83. package/dist/Form/FormItem/index.d.ts +5 -0
  84. package/dist/Form/FormItem/index.js +3 -0
  85. package/dist/Form/index.d.ts +9 -2
  86. package/dist/Form/index.js +5 -1
  87. package/dist/Form/style.scss +100 -0
  88. package/dist/FormCell/index.d.ts +3 -0
  89. package/dist/FormCell/index.js +2 -0
  90. package/dist/ImagesPreview/ImagesPreview.js +4 -3
  91. package/dist/ImagesPreview/style.scss +34 -34
  92. package/dist/ImagesWall/ImagesWall.js +1 -1
  93. package/dist/ImagesWall/style.scss +70 -70
  94. package/dist/Input/index.d.ts +17 -2
  95. package/dist/Input/index.js +13 -1
  96. package/dist/Input/index.scss +282 -0
  97. package/dist/Input/input-affix-wrapper.d.ts +13 -0
  98. package/dist/Input/input-affix-wrapper.js +37 -0
  99. package/dist/Input/input-digit.d.ts +7 -0
  100. package/dist/Input/input-digit.js +53 -0
  101. package/dist/Input/input-number.d.ts +7 -0
  102. package/dist/Input/input-number.js +50 -0
  103. package/dist/Input/input-opt.d.ts +16 -0
  104. package/dist/Input/input-opt.js +87 -0
  105. package/dist/Input/input-password.d.ts +8 -0
  106. package/dist/Input/input-password.js +49 -0
  107. package/dist/Input/input.d.ts +3 -0
  108. package/dist/Input/input.js +7 -0
  109. package/dist/Input/taro-input.d.ts +8 -0
  110. package/dist/Input/taro-input.js +70 -0
  111. package/dist/Input/textarea.d.ts +15 -0
  112. package/dist/Input/textarea.js +52 -0
  113. package/dist/Input/types.d.ts +20 -0
  114. package/dist/Input/types.js +2 -0
  115. package/dist/Loading/index.d.ts +4 -0
  116. package/dist/Loading/index.js +3 -0
  117. package/dist/Overlay/Overlay.d.ts +17 -0
  118. package/dist/Overlay/Overlay.js +100 -0
  119. package/dist/Overlay/index.d.ts +4 -0
  120. package/dist/Overlay/index.js +3 -0
  121. package/dist/Overlay/style.scss +20 -0
  122. package/dist/Picker/Picker.d.ts +27 -0
  123. package/dist/Picker/Picker.js +100 -0
  124. package/dist/Picker/index.d.ts +1 -1
  125. package/dist/Picker/index.js +1 -1
  126. package/dist/Picker/style.scss +41 -0
  127. package/dist/PickerView/PickerView.d.ts +4 -0
  128. package/dist/PickerView/PickerView.js +71 -0
  129. package/dist/PickerView/index.d.ts +2 -2
  130. package/dist/PickerView/index.js +1 -1
  131. package/dist/PickerView/style.scss +13 -0
  132. package/dist/PickerView/types.d.ts +15 -0
  133. package/dist/PickerView/types.js +1 -0
  134. package/dist/Popup/Popup.d.ts +48 -0
  135. package/dist/Popup/Popup.js +135 -0
  136. package/dist/Popup/index.d.ts +2 -1
  137. package/dist/Popup/index.js +2 -1
  138. package/dist/Popup/style.scss +126 -0
  139. package/dist/Progress/index.d.ts +1 -1
  140. package/dist/Progress/index.js +1 -1
  141. package/dist/Segmented/index.d.ts +3 -0
  142. package/dist/Segmented/index.js +2 -0
  143. package/dist/SideBar/side-bar.js +9 -8
  144. package/dist/SideBar/style.scss +85 -85
  145. package/dist/Stepper/index.d.ts +3 -0
  146. package/dist/Stepper/index.js +2 -0
  147. package/dist/Toast/Toast.d.ts +18 -0
  148. package/dist/Toast/Toast.js +112 -0
  149. package/dist/Toast/index.d.ts +1 -1
  150. package/dist/Toast/index.js +1 -1
  151. package/dist/Toast/style.scss +63 -0
  152. package/dist/VerificationCodeInput/index.d.ts +2 -2
  153. package/dist/VerificationCodeInput/index.js +1 -1
  154. package/dist/VerificationCodeInput/style.scss +20 -0
  155. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  156. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  157. package/dist/index.d.ts +28 -7
  158. package/dist/index.js +12 -2
  159. package/dist/style/variable.scss +34 -1
  160. package/dist/types.d.ts +0 -1
  161. package/dist/utils/dayjs.d.ts +4 -0
  162. package/dist/utils/dayjs.js +42 -0
  163. package/package.json +25 -30
  164. package/readme.md +23 -23
  165. package/dist/Mask/index.d.ts +0 -3
  166. package/dist/Mask/index.js +0 -2
  167. package/dist/Progress/Progress.d.ts +0 -38
  168. package/dist/Progress/Progress.js +0 -53
  169. package/dist/Progress/ProgressCircle.d.ts +0 -16
  170. package/dist/Progress/ProgressCircle.js +0 -147
  171. package/dist/Progress/ProgressLine.d.ts +0 -15
  172. package/dist/Progress/ProgressLine.js +0 -87
  173. package/dist/Progress/style.scss +0 -33
  174. package/dist/Progress/types.d.ts +0 -4
  175. package/dist/Progress/types.js +0 -2
  176. package/dist/SpinLoading/index.d.ts +0 -3
  177. package/dist/SpinLoading/index.js +0 -2
  178. /package/dist/CalendarPicker/{calendar-picker.d.ts → CalendarPicker.d.ts} +0 -0
  179. /package/dist/CalendarPicker/{calendar-range-picker.d.ts → CalendarRangePicker.d.ts} +0 -0
@@ -1,54 +1,62 @@
1
- @use "../style/variable" as variable;
2
-
3
- $calendarDatetimePickerCls: 'triones-antm-calendar-datetime-picker';
4
-
5
- .#{$calendarDatetimePickerCls} {
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
-
14
-
15
- &-display {
16
- display: flex;
17
- padding-left: 8Px;
18
-
19
- &-date {
20
- padding-inline: 8Px;
21
- cursor: default;
22
- display: flex;
23
- align-items: center;
24
- }
25
-
26
- &-time {
27
- padding-inline: 12Px;
28
- display: flex;
29
- align-items: center;
30
- cursor: default;
31
- }
32
-
33
- &-active {
34
- color: variable.$trionesColorText;
35
- font-weight: bold;
36
- background-color: variable.$trionesColorBgTextActive;
37
- }
38
- }
39
-
40
- &-button {
41
- padding: 12Px 16Px;
42
-
43
- &-cancel {
44
- }
45
-
46
- &-ok {
47
- color: variable.$trionesColorPrimary;
48
- }
49
- }
50
- }
51
- &-body {
52
-
53
- }
54
- }
1
+ @use "../style/variable" as variable;
2
+
3
+ $calendarDatetimePickerCls: 'triones-antm-calendar-datetime-picker';
4
+
5
+ .#{$calendarDatetimePickerCls} {
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
+
14
+
15
+ &-display {
16
+ display: flex;
17
+ padding-left: 8Px;
18
+
19
+ &-date {
20
+ padding-inline: 8Px;
21
+ cursor: default;
22
+ display: flex;
23
+ align-items: center;
24
+ }
25
+
26
+ &-time {
27
+ padding-inline: 12Px;
28
+ display: flex;
29
+ align-items: center;
30
+ cursor: default;
31
+ }
32
+
33
+ &-active {
34
+ color: variable.$trionesColorText;
35
+ font-weight: bold;
36
+ background-color: variable.$trionesColorBgTextActive;
37
+ }
38
+ }
39
+
40
+ &-button {
41
+ padding: 12Px 16Px;
42
+
43
+ &-cancel {}
44
+
45
+ &-ok {
46
+ color: variable.$trionesColorPrimary;
47
+ }
48
+ }
49
+ }
50
+
51
+ &-body {
52
+ .time-picker {
53
+ .time-item {
54
+ flex-shrink: 0;
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ height: 32Px;
59
+ }
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import dayjs from "dayjs";
3
+ import { FormCellProps } from "../FormCell";
4
+ export type CalendarDatetimePickerCellProps = Omit<FormCellProps, 'value'> & {
5
+ value?: dayjs.Dayjs | Date;
6
+ format?: string;
7
+ onChange?: (value?: dayjs.Dayjs) => void;
8
+ };
9
+ export declare const CalendarDatetimePickerCell: FC<CalendarDatetimePickerCellProps>;
@@ -0,0 +1,60 @@
1
+ var _excluded = ["value", "format", "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, { useEffect, useState } from 'react';
12
+ import CalendarDatetimePicker from "../CalendarDatetimePicker";
13
+ import dayjs from "dayjs";
14
+ import { isSame } from "../utils/dayjs";
15
+ import FormCell from "../FormCell";
16
+ export var CalendarDatetimePickerCell = function CalendarDatetimePickerCell(_ref) {
17
+ var value = _ref.value,
18
+ _ref$format = _ref.format,
19
+ format = _ref$format === void 0 ? 'YYYY-MM-DD HH:mm' : _ref$format,
20
+ onChange = _ref.onChange,
21
+ rest = _objectWithoutProperties(_ref, _excluded);
22
+ var _React$useState = React.useState(false),
23
+ _React$useState2 = _slicedToArray(_React$useState, 2),
24
+ innerOpen = _React$useState2[0],
25
+ setInnerOpen = _React$useState2[1];
26
+ var _useState = useState(value ? dayjs(value) : undefined),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ internalValue = _useState2[0],
29
+ setInternalValue = _useState2[1];
30
+ var handleValueRender = function handleValueRender() {
31
+ if (internalValue) {
32
+ return internalValue.format(format);
33
+ }
34
+ return null;
35
+ };
36
+ useEffect(function () {
37
+ if (value === undefined) {
38
+ return;
39
+ }
40
+ if (!isSame(value, internalValue)) {
41
+ setInternalValue(dayjs(value));
42
+ }
43
+ }, [value]);
44
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CalendarDatetimePicker, {
45
+ open: innerOpen,
46
+ value: internalValue || dayjs(),
47
+ onClose: function onClose() {
48
+ setInnerOpen(false);
49
+ },
50
+ onOk: function onOk(date) {
51
+ setInternalValue(date);
52
+ setInnerOpen(false);
53
+ onChange === null || onChange === void 0 || onChange(date);
54
+ }
55
+ }), /*#__PURE__*/React.createElement(FormCell, _extends({}, rest, {
56
+ onClick: function onClick() {
57
+ setInnerOpen(true);
58
+ }
59
+ }), handleValueRender()));
60
+ };
@@ -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;
@@ -10,13 +10,16 @@ import Calendar from "../Calendar";
10
10
  import ConfigProvider from "../ConfigProvider";
11
11
  import Popup from "../Popup";
12
12
  import "./style.scss";
13
- var cls = 'triones-antm-calendar-picker';
13
+ import { cls } from "./types";
14
+ import dayjs from "dayjs";
15
+ import { isSame } from "../utils/dayjs";
14
16
  export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
15
- var mouth = _ref.mouth,
17
+ var month = _ref.month,
16
18
  open = _ref.open,
17
19
  title = _ref.title,
18
20
  afterOpenChange = _ref.afterOpenChange,
19
- value = _ref.value,
21
+ _ref$value = _ref.value,
22
+ value = _ref$value === void 0 ? dayjs() : _ref$value,
20
23
  onOk = _ref.onOk,
21
24
  onCancel = _ref.onCancel,
22
25
  _onClose = _ref.onClose;
@@ -44,7 +47,7 @@ export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
44
47
  }, [innerOpen]);
45
48
  useEffect(function () {
46
49
  if (value !== undefined) {
47
- if (value !== valueRef.current) {
50
+ if (!isSame(value, valueRef.current, 'day')) {
48
51
  valueRef.current = value;
49
52
  }
50
53
  }
@@ -60,6 +63,7 @@ export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
60
63
  }, [open]);
61
64
  return /*#__PURE__*/React.createElement(Popup, {
62
65
  open: innerOpen,
66
+ round: true,
63
67
  onClose: function onClose() {
64
68
  setInnerOpen(false);
65
69
  _onClose === null || _onClose === void 0 || _onClose();
@@ -69,7 +73,7 @@ export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
69
73
  }, /*#__PURE__*/React.createElement("div", {
70
74
  className: classNames("".concat(cls, "-header"))
71
75
  }, /*#__PURE__*/React.createElement("a", {
72
- className: classNames("".concat(cls, "-header-button"), "".concat(cls, "-header-cancel")),
76
+ className: classNames("".concat(cls, "-header-button"), "".concat(cls, "-header-button-cancel")),
73
77
  onClick: handelCancel
74
78
  }, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
75
79
  className: classNames("".concat(cls, "-header-title"))
@@ -79,7 +83,7 @@ export var CalendarPicker = /*#__PURE__*/memo(function (_ref) {
79
83
  }, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
80
84
  className: classNames("".concat(cls, "-body"))
81
85
  }, /*#__PURE__*/React.createElement(Calendar, {
82
- mouth: mouth,
86
+ month: month,
83
87
  value: value,
84
88
  onChange: function onChange(date) {
85
89
  valueRef.current = date;
@@ -9,10 +9,11 @@ import Popup from "../Popup";
9
9
  import classNames from "classnames";
10
10
  import Calendar from "../Calendar";
11
11
  import "./style.scss";
12
+ import { cls } from "./types";
12
13
  import ConfigProvider from "../ConfigProvider";
13
- var cls = 'triones-antm-calendar-picker';
14
+ import { isSameArray } from "../utils/dayjs";
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,7 +45,7 @@ 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
+ if (!isSameArray(value, valueRef.current, 'day')) {
48
49
  valueRef.current = value;
49
50
  }
50
51
  }
@@ -60,6 +61,7 @@ export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
60
61
  }, [open]);
61
62
  return /*#__PURE__*/React.createElement(Popup, {
62
63
  open: innerOpen,
64
+ round: true,
63
65
  onClose: function onClose() {
64
66
  setInnerOpen(false);
65
67
  _onClose === null || _onClose === void 0 || _onClose();
@@ -69,17 +71,17 @@ export var CalendarRangePicker = /*#__PURE__*/memo(function (_ref) {
69
71
  }, /*#__PURE__*/React.createElement("div", {
70
72
  className: classNames("".concat(cls, "-header"))
71
73
  }, /*#__PURE__*/React.createElement("a", {
72
- className: classNames("".concat(cls, "-header-button")),
74
+ className: classNames("".concat(cls, "-header-button"), "".concat(cls, "-header-button-cancel")),
73
75
  onClick: handelCancel
74
76
  }, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
75
77
  className: classNames("".concat(cls, "-header-title"))
76
78
  }, title), /*#__PURE__*/React.createElement("a", {
77
- className: classNames("".concat(cls, "-header-button")),
79
+ className: classNames("".concat(cls, "-header-button"), "".concat(cls, "-header-button-ok")),
78
80
  onClick: handleOk
79
81
  }, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
80
82
  className: classNames("".concat(cls, "-body"))
81
83
  }, /*#__PURE__*/React.createElement(Calendar.Range, {
82
- mouth: mouth,
84
+ month: month,
83
85
  value: value,
84
86
  onChange: function onChange(date) {
85
87
  valueRef.current = date;
@@ -1,9 +1,8 @@
1
- import { CalendarPicker as InternalCalendarPicker } from "./calendar-picker";
2
- import { CalendarRangePicker } from "./calendar-range-picker";
3
- import { CalendarPickerProps } from "./types";
1
+ import { CalendarPicker as InternalCalendarPicker } from "./CalendarPicker";
2
+ import { CalendarRangePicker } from "./CalendarRangePicker";
4
3
  type CompoundedComponent = typeof InternalCalendarPicker & {
5
4
  Range: typeof CalendarRangePicker;
6
5
  };
7
6
  declare const CalendarPicker: CompoundedComponent;
8
- export type { CalendarPickerProps };
7
+ export type { CalendarPickerProps, CalendarPickerRangeProps } from "./types";
9
8
  export default CalendarPicker;
@@ -1,5 +1,5 @@
1
- import { CalendarPicker as InternalCalendarPicker } from "./calendar-picker";
2
- import { CalendarRangePicker } from "./calendar-range-picker";
1
+ import { CalendarPicker as InternalCalendarPicker } from "./CalendarPicker";
2
+ import { CalendarRangePicker } from "./CalendarRangePicker";
3
3
  var CalendarPicker = InternalCalendarPicker;
4
4
  CalendarPicker.Range = CalendarRangePicker;
5
5
  export default CalendarPicker;
@@ -1,31 +1,32 @@
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
+ color: variable.$trionesColorTextSecondary;
19
+ }
20
+
21
+ &-ok {
22
+ color: variable.$trionesColorPrimary;
23
+ }
24
+ }
25
+
26
+
27
+ }
28
+
29
+ &-body {
30
+ pointer-events: unset;
31
+ }
32
+ }
@@ -1,21 +1,23 @@
1
1
  import React from "react";
2
+ import dayjs from "dayjs";
3
+ export declare const cls = "triones-antm-calendar-picker";
2
4
  export type CalendarPickerProps = {
3
- mouth?: Date;
5
+ month?: dayjs.Dayjs;
4
6
  open?: boolean;
5
7
  title?: React.ReactNode;
6
8
  afterOpenChange?: (open: boolean) => void;
7
- value?: Date;
8
- onOk?: (value?: Date) => void;
9
+ value?: dayjs.Dayjs;
10
+ onOk?: (value?: dayjs.Dayjs) => void;
9
11
  onCancel?: () => void;
10
12
  onClose?: () => void;
11
13
  };
12
14
  export type CalendarPickerRangeProps = {
13
- mouth?: Date;
15
+ month?: dayjs.Dayjs;
14
16
  open?: boolean;
15
17
  title?: React.ReactNode;
16
18
  afterOpenChange?: (open: boolean) => void;
17
- value?: Date[];
18
- onOk?: (value?: Date[]) => void;
19
+ value?: dayjs.Dayjs[];
20
+ onOk?: (value?: dayjs.Dayjs[]) => void;
19
21
  onCancel?: () => void;
20
22
  onClose?: () => void;
21
23
  };
@@ -1 +1 @@
1
- export {};
1
+ export var cls = 'triones-antm-calendar-picker';
@@ -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;
7
+ title?: React.ReactNode;
8
+ value?: dayjs.Dayjs;
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,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;
@@ -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>;