@nokecy/qc-ui 0.8.7 → 0.8.9

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.
@@ -0,0 +1,133 @@
1
+ :root {
2
+ --alert-size: 120px;
3
+ }
4
+
5
+ .successOverlay::before,
6
+ .successOverlay::after {
7
+ position: absolute;
8
+ width: var(--alert-size);
9
+ height: 100%;
10
+ content: '';
11
+ }
12
+
13
+ .successOverlay > div::before,
14
+ .successOverlay > div::after {
15
+ position: absolute;
16
+ width: 100%;
17
+ height: var(--alert-size);
18
+ content: '';
19
+ }
20
+
21
+ .successOverlay::before {
22
+ top: 0;
23
+ left: 0;
24
+ background: linear-gradient(to right, green, transparent);
25
+ transform: rotate(0deg);
26
+ }
27
+
28
+ .successOverlay::after {
29
+ top: 0%;
30
+ left: 100%;
31
+ background: linear-gradient(to left, green, transparent);
32
+ transform: rotate(0deg) translate(calc(-1 * var(--alert-size)), 0px);
33
+ }
34
+
35
+ .successOverlay > div::before {
36
+ top: 0;
37
+ left: 0;
38
+ background: linear-gradient(to top, green, transparent);
39
+ transform: rotate(180deg);
40
+ }
41
+
42
+ .successOverlay > div::after {
43
+ top: 100%;
44
+ left: 0;
45
+ background: linear-gradient(to top, green, transparent);
46
+ transform: rotate(0deg) translate(0px, calc(-1 * var(--alert-size)));
47
+ }
48
+
49
+ .successOverlay {
50
+ position: absolute;
51
+ top: 0;
52
+ left: 0;
53
+ z-index: 1;
54
+ box-sizing: border-box;
55
+ width: 100%;
56
+ height: 100%;
57
+ opacity: 1;
58
+ transition: opacity 0.5s;
59
+ pointer-events: none;
60
+ }
61
+
62
+ .errorOverlay::before,
63
+ .errorOverlay::after {
64
+ position: absolute;
65
+ width: var(--alert-size);
66
+ height: 100%;
67
+ content: '';
68
+ }
69
+
70
+ .errorOverlay > div::before,
71
+ .errorOverlay > div::after {
72
+ position: absolute;
73
+ width: 100%;
74
+ height: var(--alert-size);
75
+ content: '';
76
+ }
77
+
78
+ .errorOverlay::before {
79
+ top: 0;
80
+ left: 0;
81
+ background: linear-gradient(to right, red, transparent);
82
+ transform: rotate(0deg);
83
+ }
84
+
85
+ .errorOverlay::after {
86
+ top: 0%;
87
+ left: 100%;
88
+ background: linear-gradient(to left, red, transparent);
89
+ transform: rotate(0deg) translate(calc(-1 * var(--alert-size)), 0px);
90
+ }
91
+
92
+ .errorOverlay > div::before {
93
+ top: 0;
94
+ left: 0;
95
+ background: linear-gradient(to top, red, transparent);
96
+ transform: rotate(180deg);
97
+ }
98
+
99
+ .errorOverlay > div::after {
100
+ top: 100%;
101
+ left: 0;
102
+ background: linear-gradient(to top, red, transparent);
103
+ transform: rotate(0deg) translate(0px, calc(-1 * var(--alert-size)));
104
+ }
105
+
106
+ .errorOverlay {
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ z-index: 1;
111
+ box-sizing: border-box;
112
+ width: 100%;
113
+ height: 100%;
114
+ opacity: 1;
115
+ transition: opacity 0.5s;
116
+ pointer-events: none;
117
+ }
118
+
119
+ .alert-active {
120
+ animation: blink 0.75s infinite;
121
+ }
122
+
123
+ @keyframes blink {
124
+ 0% {
125
+ opacity: 0;
126
+ }
127
+ 50% {
128
+ opacity: 0.5;
129
+ }
130
+ 100% {
131
+ opacity: 0;
132
+ }
133
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /**
3
+ * 通用导入弹出框
4
+ * @param props
5
+ * @returns
6
+ */
7
+ declare const ImportModal: (props: any) => React.JSX.Element;
8
+ export default ImportModal;
@@ -0,0 +1,75 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { Alert, Button, message, Modal, Upload } from 'antd';
8
+ import { InboxOutlined, ImportOutlined } from '@ant-design/icons';
9
+ import React from 'react';
10
+ import { useBoolean } from 'ahooks';
11
+
12
+ /**
13
+ * 通用导入弹出框
14
+ * @param props
15
+ * @returns
16
+ */
17
+ var ImportModal = function ImportModal(props) {
18
+ var onAfterSubmit = props.onAfterSubmit,
19
+ title = props.title,
20
+ downUrl = props.downUrl,
21
+ uploadUrl = props.uploadUrl,
22
+ children = props.children,
23
+ id = props.id,
24
+ downloadBlob = props.downloadBlob,
25
+ serverUrl = props.serverUrl;
26
+ var _useBoolean = useBoolean(false),
27
+ _useBoolean2 = _slicedToArray(_useBoolean, 2),
28
+ visible = _useBoolean2[0],
29
+ _useBoolean2$ = _useBoolean2[1],
30
+ setTrue = _useBoolean2$.setTrue,
31
+ setFalse = _useBoolean2$.setFalse;
32
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
33
+ icon: /*#__PURE__*/React.createElement(ImportOutlined, null),
34
+ onClick: setTrue
35
+ }, children || "导入"), /*#__PURE__*/React.createElement(Modal, {
36
+ title: "\u6279\u91CF\u5BFC\u5165".concat(title),
37
+ open: visible,
38
+ onCancel: setFalse,
39
+ destroyOnClose: true
40
+ }, /*#__PURE__*/React.createElement(Alert, {
41
+ message: /*#__PURE__*/React.createElement("span", null, "\u70B9\u51FB\u4E0B\u8F7D", ' ', /*#__PURE__*/React.createElement("a", {
42
+ onClick: function onClick() {
43
+ downloadBlob(downUrl, "\u6279\u91CF\u4E0A\u4F20".concat(title, "\u6A21\u7248.xlsx"));
44
+ }
45
+ }, "\u6A21\u7248")),
46
+ type: 'info'
47
+ }), /*#__PURE__*/React.createElement(Upload.Dragger, {
48
+ style: {
49
+ marginTop: 10
50
+ },
51
+ multiple: false,
52
+ action: id && id.length > 0 ? "".concat(serverUrl()).concat(uploadUrl, "?id=").concat(id || '') : "".concat(serverUrl()).concat(uploadUrl),
53
+ onChange: function onChange(info) {
54
+ if (info.file.status === 'done') {
55
+ message.success('导入成功');
56
+ setFalse();
57
+ if (onAfterSubmit) onAfterSubmit(info.file.response);
58
+ }
59
+ if (info.file.status === 'error') {
60
+ var _info$file;
61
+ Modal.info({
62
+ title: '导入失败,原因如下:',
63
+ closable: true,
64
+ width: 1000,
65
+ content: info === null || info === void 0 || (_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 || (_info$file = _info$file.error) === null || _info$file === void 0 ? void 0 : _info$file.message
66
+ });
67
+ }
68
+ }
69
+ }, /*#__PURE__*/React.createElement("p", {
70
+ className: "ant-upload-drag-icon"
71
+ }, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
72
+ className: "ant-upload-text"
73
+ }, "\u5355\u51FB\u6216\u62D6\u52A8\u6587\u4EF6\u5230\u8BE5\u533A\u57DF\u4E0A\u4F20"))));
74
+ };
75
+ export default ImportModal;
@@ -11,4 +11,8 @@ import { FormDesigner } from "./formDesigner";
11
11
  import { FormProLayout } from "./formPro";
12
12
  import { FormProContext } from "./formPro/context/formProContext";
13
13
  import QueryBuilder from "./queryBuilder";
14
- export { AgGridColumn, AgGridPlus, ArrayTable, ArrayTableIndex, Card, Dashboard, DialogSelect, DraggableModal, Editable, ExtensibleGrid, flattenTreeDeep, FormDesigner, FormProContext, FormProLayout, GridPlusContext, QueryBuilder, };
14
+ import ToolBar from "./toolBar";
15
+ import ImportModal from "./importModal";
16
+ import FullScreenAlert from "./fullScreenAlert";
17
+ import ConfirmPro from "./ConfirmPro";
18
+ export { AgGridColumn, AgGridPlus, ArrayTable, ArrayTableIndex, Card, Dashboard, DialogSelect, DraggableModal, Editable, ExtensibleGrid, flattenTreeDeep, FormDesigner, FormProContext, FormProLayout, GridPlusContext, ImportModal, QueryBuilder, ToolBar, FullScreenAlert, ConfirmPro };
package/dist/esm/index.js CHANGED
@@ -11,4 +11,8 @@ import { FormDesigner } from "./formDesigner";
11
11
  import { FormProLayout } from "./formPro";
12
12
  import { FormProContext } from "./formPro/context/formProContext";
13
13
  import QueryBuilder from "./queryBuilder";
14
- export { AgGridColumn, AgGridPlus, ArrayTable, ArrayTableIndex, Card, Dashboard, DialogSelect, DraggableModal, Editable, ExtensibleGrid, flattenTreeDeep, FormDesigner, FormProContext, FormProLayout, GridPlusContext, QueryBuilder };
14
+ import ToolBar from "./toolBar";
15
+ import ImportModal from "./importModal";
16
+ import FullScreenAlert from "./fullScreenAlert";
17
+ import ConfirmPro from "./ConfirmPro";
18
+ export { AgGridColumn, AgGridPlus, ArrayTable, ArrayTableIndex, Card, Dashboard, DialogSelect, DraggableModal, Editable, ExtensibleGrid, flattenTreeDeep, FormDesigner, FormProContext, FormProLayout, GridPlusContext, ImportModal, QueryBuilder, ToolBar, FullScreenAlert, ConfirmPro };