@ecoding/components.antd 0.1.29 → 0.1.34

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.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  export interface IDrawerProps {
3
3
  key?: string;
4
4
  id?: string;
@@ -9,6 +9,7 @@ export interface IDrawerProps {
9
9
  open?: boolean;
10
10
  width?: string;
11
11
  zIndex?: number;
12
+ okDanger?: boolean;
12
13
  title?: React.ReactNode;
13
14
  okType?: "text" | "link" | "ghost" | "default" | "primary" | "dashed" | undefined;
14
15
  okText?: string;
@@ -32,6 +33,7 @@ export declare class Drawers extends React.Component<IDrawerProps> {
32
33
  mask: boolean;
33
34
  title: string;
34
35
  okType: string;
36
+ okDanger: boolean;
35
37
  okText: string;
36
38
  cancelText: string;
37
39
  maskClosable: boolean;
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
- import { Drawer, Button } from 'antd';
3
- import InjectNotification from '../inject-notification';
1
+ import React from "react";
2
+ import { Drawer, Button } from "antd";
3
+ import InjectNotification from "../inject-notification";
4
4
  const timeout = 300;
5
5
  export class Drawers extends React.Component {
6
6
  constructor() {
@@ -52,7 +52,7 @@ export class Drawers extends React.Component {
52
52
  return (React.createElement(Drawer, { className: this.props.className, bodyStyle: this.props.bodyStyle, open: this.state.open, destroyOnClose: true, maskClosable: this.props.maskClosable, keyboard: false, title: this.props.title, footer: this.props.footer === null ? null : this.props.footer ? (this.props.footer) : (React.createElement("div", { className: "tac" },
53
53
  this.props.addonBefore ? this.props.addonBefore : null,
54
54
  React.createElement(Button, { className: "mr10", key: "back", onClick: this.cancel }, this.props.cancelText),
55
- React.createElement(Button, { key: "submit", type: this.props.okType, loading: this.state.loading, onClick: this.ok }, this.props.okText),
55
+ React.createElement(Button, { 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
  }
@@ -65,6 +65,7 @@ Drawers.defaultProps = {
65
65
  mask: true,
66
66
  title: "标题",
67
67
  okType: "primary",
68
+ okDanger: false,
68
69
  okText: "保存",
69
70
  cancelText: "取消",
70
71
  maskClosable: true,
@@ -5,10 +5,11 @@ export interface IModalProps {
5
5
  className?: string;
6
6
  open?: boolean;
7
7
  bodyStyle?: React.CSSProperties;
8
- width?: string;
8
+ width?: string | number;
9
9
  zIndex?: number;
10
10
  mask?: boolean;
11
11
  title?: React.ReactNode;
12
+ okDanger?: boolean;
12
13
  okType?: "text" | "link" | "ghost" | "default" | "primary" | "dashed" | undefined;
13
14
  okText?: string;
14
15
  cancelText?: string;
@@ -34,6 +35,7 @@ export declare class Modals extends React.Component<IModalProps> {
34
35
  okType: string;
35
36
  okText: string;
36
37
  cancelText: string;
38
+ okDanger: boolean;
37
39
  closable: boolean;
38
40
  maskClosable: boolean;
39
41
  footer: string;
@@ -52,7 +52,7 @@ export class Modals extends React.Component {
52
52
  return (React.createElement(Modal, { className: this.props.className, open: this.state.open, bodyStyle: this.props.bodyStyle, width: this.props.width, zIndex: this.props.zIndex, mask: this.props.mask, title: typeof this.props.title === "string" ? (React.createElement("div", { style: { boxShadow: "inset 0px -1px 0px #F0F0F0", marginBottom: "20px", paddingBottom: "12px" } }, this.props.title)) : (this.props.title), closable: this.props.closable, maskClosable: this.props.maskClosable, onCancel: this.cancel, destroyOnClose: true, keyboard: false, footer: this.props.footer === null ? null : this.props.footer ? (this.props.footer) : (React.createElement(React.Fragment, null,
53
53
  this.props.addonBefore ? this.props.addonBefore : null,
54
54
  React.createElement(Button, { key: "back", onClick: this.cancel }, this.props.cancelText),
55
- React.createElement(Button, { key: "submit", type: this.props.okType, loading: this.state.loading, onClick: this.ok }, this.props.okText),
55
+ React.createElement(Button, { 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)) }, this.props.component ? this.props.component : null));
57
57
  }
58
58
  }
@@ -67,6 +67,7 @@ Modals.defaultProps = {
67
67
  okType: "primary",
68
68
  okText: "保存",
69
69
  cancelText: "取消",
70
+ okDanger: false,
70
71
  closable: true,
71
72
  maskClosable: true,
72
73
  footer: "",
@@ -1,9 +1,11 @@
1
+ import React from "react";
1
2
  interface IToastFCProps {
2
3
  id?: string;
3
4
  key?: string;
4
5
  mask?: boolean;
5
- title?: string;
6
+ title?: React.ReactNode;
6
7
  maskTheme?: string;
8
+ message?: React.ReactNode;
7
9
  duration?: number;
8
10
  auto?: boolean;
9
11
  type?: "error" | "warning" | "info" | "success";
@@ -7,10 +7,10 @@ var EaskTheme;
7
7
  EaskTheme["light"] = "#fff";
8
8
  })(EaskTheme || (EaskTheme = {}));
9
9
  const typeMap = {
10
- error: "错误",
11
- warning: "警告",
12
- info: "提示",
13
- success: "成功"
10
+ error: "Error",
11
+ warning: "Warning",
12
+ info: "Info",
13
+ success: "Success"
14
14
  };
15
15
  const ToastFC = (props) => {
16
16
  const maskStyle = {
@@ -47,14 +47,15 @@ const ToastFC = (props) => {
47
47
  return (React.createElement(React.Fragment, null,
48
48
  props.mask ? (React.createElement("div", { style: Object.assign(maskStyle, { backgroundColor: props.maskTheme === "light" ? EaskTheme.light : EaskTheme.dark }) })) : null,
49
49
  React.createElement("div", { style: alertStyle },
50
- React.createElement(Alert, { description: props.title, message: typeMap[props.type], type: props.type, showIcon: true, closable: true, onClose: () => InjectNotification.removeNotice(props.id) }))));
50
+ React.createElement(Alert, { description: props.title, message: props.message || typeMap[props.type], type: props.type, showIcon: true, closable: true, onClose: () => InjectNotification.removeNotice(props.id) }))));
51
51
  };
52
52
  ToastFC.defaultProps = {
53
53
  mask: false,
54
- title: "提示",
54
+ title: "",
55
55
  maskTheme: "light",
56
56
  duration: 2000,
57
57
  auto: true,
58
+ message: "",
58
59
  type: "success"
59
60
  };
60
61
  const show = (props = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.1.29",
3
+ "version": "0.1.34",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -43,5 +43,5 @@
43
43
  "dependencies": {
44
44
  "react-quill": "^2.0.0"
45
45
  },
46
- "gitHead": "1b1f335f0b51b302577a95ee2ff24a41f747b6b6"
46
+ "gitHead": "ff1761cf075399b059a3030c192b81f1426828f2"
47
47
  }