@ucloud-fe/react-components 1.4.0 → 1.4.1

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.
@@ -10,6 +10,7 @@ declare type Mode = 'date' | 'month';
10
10
  export declare const TipIcon: React.NamedExoticComponent<object>;
11
11
  interface FooterProps {
12
12
  mode: Mode;
13
+ confirmAble: boolean;
13
14
  onConfirm: () => void;
14
15
  shortcuts?: TShortcut[] | null;
15
16
  onShortcut: (d: TDate) => void;
@@ -18,5 +19,5 @@ interface FooterProps {
18
19
  locale?: typeof LOCALE;
19
20
  showConfirm?: boolean;
20
21
  }
21
- declare const _default: React.MemoExoticComponent<({ isError, onConfirm, shortcuts, onShortcut, tip, showConfirm, locale: _locale }: FooterProps) => JSX.Element | null>;
22
+ declare const _default: React.MemoExoticComponent<({ isError, confirmAble, onConfirm, shortcuts, onShortcut, tip, showConfirm, locale: _locale }: FooterProps) => JSX.Element | null>;
22
23
  export default _default;
@@ -42,13 +42,12 @@ var TipIcon = /*#__PURE__*/_react.default.memo(function TipIcon() {
42
42
 
43
43
  exports.TipIcon = TipIcon;
44
44
 
45
- // deprecated shortcuts for UX
46
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
45
  var Footer = function Footer(_ref) {
48
46
  var _this2 = this;
49
47
 
50
48
  (0, _newArrowCheck2.default)(this, _this);
51
49
  var isError = _ref.isError,
50
+ confirmAble = _ref.confirmAble,
52
51
  onConfirm = _ref.onConfirm,
53
52
  shortcuts = _ref.shortcuts,
54
53
  onShortcut = _ref.onShortcut,
@@ -71,13 +70,14 @@ var Footer = function Footer(_ref) {
71
70
  }, /*#__PURE__*/_react.default.createElement(TipIcon, null), /*#__PURE__*/_react.default.createElement("span", null, tip)) : /*#__PURE__*/_react.default.createElement("span", null), showConfirm && /*#__PURE__*/_react.default.createElement(_Button.default, {
72
71
  styleType: "primary",
73
72
  size: "sm",
74
- disabled: isError,
73
+ disabled: !confirmAble,
75
74
  onClick: handleConfirm
76
75
  }, locale.confirm));
77
76
  }.bind(void 0);
78
77
 
79
78
  Footer.propTypes = {
80
79
  mode: _propTypes.default.oneOf(['date', 'month']).isRequired,
80
+ confirmAble: _propTypes.default.bool.isRequired,
81
81
  onConfirm: _propTypes.default.func.isRequired,
82
82
  shortcuts: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape({
83
83
  handle: _propTypes.default.func.isRequired,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucloud-fe/react-components",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "title": "UCloud react components",
5
5
  "description": "UCloud react components",
6
6
  "keywords": [