@ecoding/components.antd 0.0.1 → 0.0.2

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.
@@ -7,7 +7,7 @@ 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 { jsx as _jsx } from "react/jsx-runtime";
10
+ import React from 'react';
11
11
  import { Modal } from 'antd';
12
12
  import { ExclamationCircleOutlined } from '@ant-design/icons';
13
13
  const confirm = {
@@ -15,7 +15,7 @@ const confirm = {
15
15
  let loading = false;
16
16
  Modal.confirm({
17
17
  okType: 'danger',
18
- icon: _jsx(ExclamationCircleOutlined, {}),
18
+ icon: React.createElement(ExclamationCircleOutlined, null),
19
19
  title: opts.title || '确定要删除吗?',
20
20
  content: opts.content || '',
21
21
  okText: opts.okText || '确定',
@@ -46,7 +46,7 @@ const confirm = {
46
46
  show(opts) {
47
47
  let loading = false;
48
48
  Modal.confirm({
49
- icon: _jsx(ExclamationCircleOutlined, {}),
49
+ icon: React.createElement(ExclamationCircleOutlined, null),
50
50
  title: opts.title || '标题',
51
51
  content: opts.content || '',
52
52
  okType: opts.okType || 'primary',
@@ -1,5 +1,4 @@
1
- import { createElement as _createElement } from "react";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import React from 'react';
3
2
  import { Spin } from 'antd';
4
3
  import Notification from '../../helpers/notification';
5
4
  const notification = Notification.newInstance();
@@ -23,7 +22,10 @@ const LoadingFC = (props) => {
23
22
  zIndex: 9002,
24
23
  transform: 'translate(-50%, -70%)'
25
24
  };
26
- return (_jsxs(_Fragment, { children: [_jsx("div", { style: maskStyle }), _jsx("div", Object.assign({ style: alertStyle }, { children: _jsx(Spin, { size: "large", tip: props.tip }) }))] }));
25
+ return (React.createElement(React.Fragment, null,
26
+ React.createElement("div", { style: maskStyle }),
27
+ React.createElement("div", { style: alertStyle },
28
+ React.createElement(Spin, { size: "large", tip: props.tip }))));
27
29
  };
28
30
  LoadingFC.defaultProps = {
29
31
  tip: ''
@@ -33,7 +35,7 @@ export default {
33
35
  if (notification) {
34
36
  notification.removeNotice('loading');
35
37
  }
36
- notification.notice(_createElement(LoadingFC, Object.assign({}, props, { key: "loading" })));
38
+ notification.notice(React.createElement(LoadingFC, Object.assign({}, props, { key: "loading" })));
37
39
  },
38
40
  hide(props = {}) {
39
41
  notification.removeNotice('loading');
@@ -1,6 +1,4 @@
1
- import { createElement as _createElement } from "react";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect } from 'react';
1
+ import React, { useEffect } from 'react';
4
2
  import { Alert } from 'antd';
5
3
  import Notification from '../../helpers/notification';
6
4
  const notification = Notification.newInstance();
@@ -47,7 +45,10 @@ const ToastFC = (props) => {
47
45
  clearTimeout(timeout);
48
46
  };
49
47
  }, []);
50
- return (_jsxs(_Fragment, { children: [props.mask ? _jsx("div", { style: Object.assign(maskStyle, { backgroundColor: props.maskTheme === 'light' ? EaskTheme.light : EaskTheme.dark }) }) : null, _jsx("div", Object.assign({ style: alertStyle }, { children: _jsx(Alert, { description: props.title, message: typeMap[props.type], type: props.type, showIcon: true, closable: true, onClose: () => notification.removeNotice('toast') }) }))] }));
48
+ return (React.createElement(React.Fragment, null,
49
+ props.mask ? React.createElement("div", { style: Object.assign(maskStyle, { backgroundColor: props.maskTheme === 'light' ? EaskTheme.light : EaskTheme.dark }) }) : null,
50
+ React.createElement("div", { style: alertStyle },
51
+ React.createElement(Alert, { description: props.title, message: typeMap[props.type], type: props.type, showIcon: true, closable: true, onClose: () => notification.removeNotice('toast') }))));
51
52
  };
52
53
  ToastFC.defaultProps = {
53
54
  mask: false,
@@ -61,7 +62,7 @@ const show = (props = {}) => {
61
62
  if (notification) {
62
63
  notification.removeNotice('toast');
63
64
  }
64
- notification.notice(_createElement(ToastFC, Object.assign({}, props, { key: "toast" })));
65
+ notification.notice(React.createElement(ToastFC, Object.assign({}, props, { key: "toast" })));
65
66
  };
66
67
  export default {
67
68
  info(props = {}) {
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  import React from "react";
3
2
  import ReactDOM from "react-dom";
4
3
  // notification是父组件容器,通过其方法做额外渲染到 body 上的react节点
@@ -7,7 +6,7 @@ class Notification extends React.Component {
7
6
  static newInstance() {
8
7
  const div = document.createElement("div");
9
8
  document.body.appendChild(div);
10
- const notification = ReactDOM.render(_jsx(Notification, {}), div);
9
+ const notification = ReactDOM.render(React.createElement(Notification, null), div);
11
10
  return {
12
11
  notice(component) {
13
12
  notification.add(component);
@@ -59,7 +58,7 @@ class Notification extends React.Component {
59
58
  }
60
59
  render() {
61
60
  const noticesDOM = this.getNoticeDOM();
62
- return (_jsx(_Fragment, { children: noticesDOM }));
61
+ return (React.createElement(React.Fragment, null, noticesDOM));
63
62
  }
64
63
  }
65
64
  export default Notification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -23,5 +23,5 @@
23
23
  "dev": "tsc -w",
24
24
  "build": "rm -rf lib && tsc"
25
25
  },
26
- "gitHead": "db098300a2dd7b59f4d25fecffd878df08b80cc3"
26
+ "gitHead": "6f1f561a65700696c8d6fc008642fc936f91d3b2"
27
27
  }