@ecoding/components.antd 0.2.6 → 0.2.8

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.
@@ -26,6 +26,12 @@ export interface IDrawerProps {
26
26
  component?: React.ReactNode;
27
27
  addonBefore?: React.ReactNode;
28
28
  addonAfter?: React.ReactNode;
29
+ okButtonProps?: {
30
+ disabled: boolean;
31
+ };
32
+ cancelButtonProps?: {
33
+ disabled: boolean;
34
+ };
29
35
  }
30
36
  export declare class Drawers extends React.Component<IDrawerProps> {
31
37
  static defaultProps: {
@@ -45,6 +51,12 @@ export declare class Drawers extends React.Component<IDrawerProps> {
45
51
  maskClosable: boolean;
46
52
  closable: boolean;
47
53
  footer: null;
54
+ okButtonProps: {
55
+ disabled: boolean;
56
+ };
57
+ cancelButtonProps: {
58
+ disabled: boolean;
59
+ };
48
60
  extra: string;
49
61
  onOk: () => Promise<void>;
50
62
  onCancel: () => Promise<void>;
@@ -51,8 +51,8 @@ export class Drawers extends React.Component {
51
51
  // if (!this.props.visible) return null;
52
52
  return (React.createElement(Drawer, { className: this.props.className, bodyStyle: this.props.bodyStyle, placement: this.props.placement, height: this.props.height, open: this.state.open, destroyOnClose: true, maskClosable: this.props.maskClosable, keyboard: false, title: this.props.title, extra: this.props.extra === null ? null : this.props.extra ? (this.props.extra) : (React.createElement("div", { className: "tac" },
53
53
  this.props.addonBefore ? this.props.addonBefore : null,
54
- React.createElement(Button, { className: "mr10", key: "back", onClick: this.cancel }, this.props.cancelText),
55
- React.createElement(Button, { danger: this.props.okDanger, key: "submit", type: this.props.okType, loading: this.state.loading, onClick: this.ok }, this.props.okText),
54
+ React.createElement(Button, Object.assign({}, this.props.cancelButtonProps, { className: "mr10", key: "back", onClick: this.cancel }), this.props.cancelText),
55
+ React.createElement(Button, Object.assign({}, this.props.okButtonProps, { danger: this.props.okDanger, key: "submit", type: this.props.okType, loading: this.state.loading, onClick: this.ok }), this.props.okText),
56
56
  this.props.addonAfter ? this.props.addonAfter : null)), width: this.props.width, zIndex: this.props.zIndex, mask: this.props.mask, onClose: this.cancel, closable: this.props.closable }, this.props.component ? this.props.component : null));
57
57
  }
58
58
  }
@@ -73,6 +73,8 @@ Drawers.defaultProps = {
73
73
  maskClosable: true,
74
74
  closable: true,
75
75
  footer: null,
76
+ okButtonProps: { disabled: false },
77
+ cancelButtonProps: { disabled: false },
76
78
  extra: "",
77
79
  onOk: function () {
78
80
  return Promise.resolve();
@@ -95,7 +97,7 @@ export default {
95
97
  if (!props.cancelText) {
96
98
  props.cancelText = "取消";
97
99
  }
98
- InjectNotification.notice(React.createElement(Drawers, Object.assign({}, props, { key: props.id })));
100
+ InjectNotification.notice(React.createElement(Drawers, Object.assign({}, props, { key: props.id, ref: ref => InjectNotification[props.id] = ref })));
99
101
  },
100
102
  update(props = {}) {
101
103
  props.open = true;
@@ -94,7 +94,7 @@ export default {
94
94
  if (!props.cancelText) {
95
95
  props.cancelText = "取消";
96
96
  }
97
- InjectNotification.notice(React.createElement(Modals, Object.assign({ ref: ref => InjectNotification[props.id] = ref }, props, { key: props.id })));
97
+ InjectNotification.notice(React.createElement(Modals, Object.assign({}, props, { key: props.id, ref: ref => InjectNotification[props.id] = ref })));
98
98
  },
99
99
  update(props = {}) {
100
100
  props.open = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -44,5 +44,5 @@
44
44
  "dependencies": {
45
45
  "react-quill": "^2.0.0"
46
46
  },
47
- "gitHead": "854a6011b72e60c70cc7ba0fb949075fcddf7bd9"
47
+ "gitHead": "8c05c73f96bc4b402164ed6df9ae457588f88562"
48
48
  }