@ecoding/components.antd 0.1.2 → 0.1.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.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  interface IComfirm {
3
3
  title?: string;
4
4
  content?: React.ReactNode;
@@ -7,19 +7,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import React from 'react';
11
- import { Modal } from 'antd';
12
- import { ExclamationCircleOutlined } from '@ant-design/icons';
10
+ import React from "react";
11
+ import { Modal } from "antd";
12
+ import { ExclamationCircleOutlined } from "@ant-design/icons";
13
13
  const confirm = {
14
14
  showDelete(opts) {
15
15
  let loading = false;
16
16
  Modal.confirm({
17
- okType: 'danger',
17
+ okType: "danger",
18
18
  icon: React.createElement(ExclamationCircleOutlined, null),
19
- title: opts.title || '确定要删除吗?',
20
- content: opts.content || '',
21
- okText: opts.okText || '确定',
22
- cancelText: opts.okText || '取消',
19
+ title: opts.title || "确定要删除吗?",
20
+ content: opts.content || "",
21
+ okText: opts.okText || "确定",
22
+ cancelText: opts.cancelText || "取消",
23
23
  onOk() {
24
24
  loading = true;
25
25
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
@@ -35,23 +35,23 @@ const confirm = {
35
35
  },
36
36
  onCancel() {
37
37
  if (loading) {
38
- return Promise.reject('正在请求中,不可关闭');
38
+ return Promise.reject("正在请求中,不可关闭");
39
39
  }
40
40
  if (opts.onCancel) {
41
41
  return opts.onCancel();
42
42
  }
43
- },
43
+ }
44
44
  });
45
45
  },
46
46
  show(opts) {
47
47
  let loading = false;
48
48
  Modal.confirm({
49
49
  icon: React.createElement(ExclamationCircleOutlined, null),
50
- title: opts.title || '标题',
51
- content: opts.content || '',
52
- okType: opts.okType || 'primary',
53
- okText: opts.okText || '确定',
54
- cancelText: opts.okText || '取消',
50
+ title: opts.title || "标题",
51
+ content: opts.content || "",
52
+ okType: opts.okType || "primary",
53
+ okText: opts.okText || "确定",
54
+ cancelText: opts.cancelText || "取消",
55
55
  onOk() {
56
56
  loading = true;
57
57
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
@@ -67,12 +67,12 @@ const confirm = {
67
67
  },
68
68
  onCancel() {
69
69
  if (loading) {
70
- return Promise.reject('正在请求中,不可关闭');
70
+ return Promise.reject("正在请求中,不可关闭");
71
71
  }
72
72
  if (opts.onCancel) {
73
73
  return opts.onCancel();
74
74
  }
75
- },
75
+ }
76
76
  });
77
77
  }
78
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.1.2",
3
+ "version": "0.1.8",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -42,5 +42,5 @@
42
42
  "dependencies": {
43
43
  "react-quill": "^2.0.0"
44
44
  },
45
- "gitHead": "c5684f151e43849aae0d861de63d04f52a0d1d70"
45
+ "gitHead": "fd77cb7d70165ff09222ff2d2d0c0b1b98dafd33"
46
46
  }