@pointcloud/pcloud-components 0.0.1

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.
Files changed (87) hide show
  1. package/README.md +47 -0
  2. package/dist/cjs/AdvancedFilter/FormFilter.d.ts +5 -0
  3. package/dist/cjs/AdvancedFilter/FormFilter.js +158 -0
  4. package/dist/cjs/AdvancedFilter/demos/demo1.d.ts +3 -0
  5. package/dist/cjs/AdvancedFilter/demos/demo1.js +56 -0
  6. package/dist/cjs/AdvancedFilter/demos/demo2.d.ts +3 -0
  7. package/dist/cjs/AdvancedFilter/demos/demo2.js +63 -0
  8. package/dist/cjs/AdvancedFilter/demos/demo3.d.ts +3 -0
  9. package/dist/cjs/AdvancedFilter/demos/demo3.js +113 -0
  10. package/dist/cjs/AdvancedFilter/index.d.ts +5 -0
  11. package/dist/cjs/AdvancedFilter/index.js +114 -0
  12. package/dist/cjs/AdvancedFilter/interface.d.ts +97 -0
  13. package/dist/cjs/AdvancedFilter/interface.js +17 -0
  14. package/dist/cjs/AdvancedFilter/styles/index.less +115 -0
  15. package/dist/cjs/ErrorBoundary/index.d.ts +6 -0
  16. package/dist/cjs/ErrorBoundary/index.js +45 -0
  17. package/dist/cjs/ErrorBoundary/index.less +42 -0
  18. package/dist/cjs/LabelValue/demos/demo1.d.ts +3 -0
  19. package/dist/cjs/LabelValue/demos/demo1.js +35 -0
  20. package/dist/cjs/LabelValue/demos/demo2.d.ts +3 -0
  21. package/dist/cjs/LabelValue/demos/demo2.js +36 -0
  22. package/dist/cjs/LabelValue/demos/demo3.d.ts +3 -0
  23. package/dist/cjs/LabelValue/demos/demo3.js +36 -0
  24. package/dist/cjs/LabelValue/index.d.ts +16 -0
  25. package/dist/cjs/LabelValue/index.js +50 -0
  26. package/dist/cjs/LabelValue/interface.d.ts +29 -0
  27. package/dist/cjs/LabelValue/interface.js +17 -0
  28. package/dist/cjs/LabelValue/styles/index.less +18 -0
  29. package/dist/cjs/index.d.ts +4 -0
  30. package/dist/cjs/index.js +38 -0
  31. package/dist/esm/AdvancedFilter/FormFilter.d.ts +4 -0
  32. package/dist/esm/AdvancedFilter/FormFilter.js +199 -0
  33. package/dist/esm/AdvancedFilter/demos/demo1.d.ts +2 -0
  34. package/dist/esm/AdvancedFilter/demos/demo1.js +25 -0
  35. package/dist/esm/AdvancedFilter/demos/demo2.d.ts +2 -0
  36. package/dist/esm/AdvancedFilter/demos/demo2.js +39 -0
  37. package/dist/esm/AdvancedFilter/demos/demo3.d.ts +2 -0
  38. package/dist/esm/AdvancedFilter/demos/demo3.js +86 -0
  39. package/dist/esm/AdvancedFilter/index.d.ts +5 -0
  40. package/dist/esm/AdvancedFilter/index.js +163 -0
  41. package/dist/esm/AdvancedFilter/interface.d.ts +97 -0
  42. package/dist/esm/AdvancedFilter/interface.js +1 -0
  43. package/dist/esm/AdvancedFilter/styles/index.less +115 -0
  44. package/dist/esm/ConfigProvider/index.d.ts +6 -0
  45. package/dist/esm/ConfigProvider/index.js +19 -0
  46. package/dist/esm/ConfigProvider/interface.d.ts +11 -0
  47. package/dist/esm/ConfigProvider/interface.js +1 -0
  48. package/dist/esm/ErrorBoundary/index.d.ts +5 -0
  49. package/dist/esm/ErrorBoundary/index.js +39 -0
  50. package/dist/esm/ErrorBoundary/index.less +42 -0
  51. package/dist/esm/LabelValue/demos/demo1.d.ts +2 -0
  52. package/dist/esm/LabelValue/demos/demo1.js +9 -0
  53. package/dist/esm/LabelValue/demos/demo2.d.ts +2 -0
  54. package/dist/esm/LabelValue/demos/demo2.js +10 -0
  55. package/dist/esm/LabelValue/demos/demo3.d.ts +2 -0
  56. package/dist/esm/LabelValue/demos/demo3.js +10 -0
  57. package/dist/esm/LabelValue/index.d.ts +16 -0
  58. package/dist/esm/LabelValue/index.js +45 -0
  59. package/dist/esm/LabelValue/interface.d.ts +29 -0
  60. package/dist/esm/LabelValue/interface.js +1 -0
  61. package/dist/esm/LabelValue/styles/index.less +18 -0
  62. package/dist/esm/Loading/demos/demo1.d.ts +2 -0
  63. package/dist/esm/Loading/demos/demo1.js +17 -0
  64. package/dist/esm/Loading/demos/demo2.d.ts +2 -0
  65. package/dist/esm/Loading/demos/demo2.js +18 -0
  66. package/dist/esm/Loading/index.d.ts +9 -0
  67. package/dist/esm/Loading/index.js +27 -0
  68. package/dist/esm/Loading/interface.d.ts +13 -0
  69. package/dist/esm/Loading/interface.js +1 -0
  70. package/dist/esm/Loading/loading.d.ts +9 -0
  71. package/dist/esm/Loading/loading.js +53 -0
  72. package/dist/esm/Loading/styles/index.less +22 -0
  73. package/dist/esm/NoData/demos/demo1.d.ts +2 -0
  74. package/dist/esm/NoData/demos/demo1.js +12 -0
  75. package/dist/esm/NoData/demos/demo2.d.ts +2 -0
  76. package/dist/esm/NoData/demos/demo2.js +14 -0
  77. package/dist/esm/NoData/index.d.ts +4 -0
  78. package/dist/esm/NoData/index.js +36 -0
  79. package/dist/esm/NoData/interface.d.ts +12 -0
  80. package/dist/esm/NoData/interface.js +1 -0
  81. package/dist/esm/NoData/styles/index.less +20 -0
  82. package/dist/esm/index.d.ts +7 -0
  83. package/dist/esm/index.js +6 -0
  84. package/dist/umd/images/logo.png +0 -0
  85. package/dist/umd/pcloud-components.min.css +1 -0
  86. package/dist/umd/pcloud-components.min.js +114 -0
  87. package/package.json +73 -0
@@ -0,0 +1,115 @@
1
+ .pui-search-filter {
2
+ align-items: center;
3
+ width: 100%;
4
+ margin-top: 10px;
5
+ background-color: #fff;
6
+ span.ant-collapse-header-text {
7
+ display: inline-block;
8
+ width: 100%;
9
+ cursor: auto !important;
10
+ }
11
+ .ant-collapse-content-box {
12
+ padding: 0px;
13
+ }
14
+
15
+ .search-header {
16
+ display: flex;
17
+ width: 100%;
18
+ .left {
19
+ max-width: 100%;
20
+ overflow: hidden;
21
+ white-space: no-wrap;
22
+ text-overflow: ellipsis;
23
+ :global {
24
+ .ant-radio-wrapper:first-child {
25
+ border-left: 1px solid #d9d9d9;
26
+ border-radius: 5px 0 0 5px;
27
+ }
28
+ .ant-radio-wrapper:last-child {
29
+ border-radius: 0 5px 5px 0;
30
+ }
31
+ .ant-radio-wrapper {
32
+ margin-right: 0;
33
+ padding: 4px 6px;
34
+ border: 1px solid #d9d9d9;
35
+ border-top-width: 1px;
36
+ border-left: 1px solid #fff;
37
+ border-left-width: 1px;
38
+ .ant-radio {
39
+ display: none;
40
+ }
41
+ }
42
+ .ant-radio-wrapper:hover {
43
+ color: #1890ff;
44
+ }
45
+ .ant-radio-wrapper-checked {
46
+ z-index: 1;
47
+ color: #1890ff;
48
+ background: #fff;
49
+ border: 1px solid #1890ff;
50
+ border-left: 1px solid #1890ff !important;
51
+ }
52
+ }
53
+ }
54
+ .right {
55
+ display: flex;
56
+ justify-content: center;
57
+ .input {
58
+ width: 200px;
59
+ border-radius: 4px;
60
+ }
61
+ .button {
62
+ margin-left: 10px;
63
+ color: #fff;
64
+ background-color: #ff7e00;
65
+ border-radius: 4px;
66
+ &:active,
67
+ &:focus,
68
+ &:hover {
69
+ border-color: transparent;
70
+ }
71
+ .icon {
72
+ margin-left: 8px;
73
+ }
74
+ }
75
+ }
76
+ }
77
+ .title {
78
+ display: flex;
79
+ align-items: center;
80
+ margin: 0px 10px;
81
+ padding-bottom: 10px;
82
+ font-weight: bold;
83
+ border-bottom: 1px solid #f0f0f0;
84
+ span.icon {
85
+ width: 4px;
86
+ height: 16px;
87
+ margin-right: 6px;
88
+ background-color: #ff7e00;
89
+ border-radius: 2px;
90
+ }
91
+ }
92
+ .search-content {
93
+ .filter-row {
94
+ display: flex;
95
+ flex-wrap: wrap;
96
+ width: 100%;
97
+ padding: 10px;
98
+ }
99
+ .filter-col {
100
+ height: 30px;
101
+ margin-bottom: 10px;
102
+ line-height: 30px;
103
+ }
104
+ .filter-col .ant-picker {
105
+ width: 100%;
106
+ }
107
+
108
+ .search-btn {
109
+ justify-content: center;
110
+ > button {
111
+ margin: 0 5px;
112
+ }
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ConfigProviderProps } from './interface';
3
+ export declare const defaultPrefixCls = "pui";
4
+ export declare const ConfigContext: React.Context<ConfigProviderProps>;
5
+ declare const ConfigProvider: (props: ConfigProviderProps) => JSX.Element;
6
+ export default ConfigProvider;
@@ -0,0 +1,19 @@
1
+ import React, { createContext } from 'react';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export var defaultPrefixCls = 'pui'; // export const ConfigContext = createContext<ConfigProviderProps>({} as ConfigProviderProps);
4
+
5
+ export var ConfigContext = /*#__PURE__*/createContext({
6
+ getPrefixCls: function getPrefixCls(componentName, customPrefix) {
7
+ return "".concat(customPrefix || defaultPrefixCls, "-").concat(componentName);
8
+ }
9
+ });
10
+
11
+ var ConfigProvider = function ConfigProvider(props) {
12
+ var children = props.children;
13
+ return /*#__PURE__*/_jsx(ConfigContext.Provider, {
14
+ value: props,
15
+ children: children
16
+ });
17
+ };
18
+
19
+ export default ConfigProvider;
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ export interface ConfigProviderProps {
3
+ /**
4
+ * @description 全局组件类名前缀
5
+ * @default pui
6
+ */
7
+ prefixCls?: string;
8
+ getPrefixCls?: (componentName: string, customPrefix?: string) => string;
9
+ children?: React.ReactNode;
10
+ }
11
+ export declare type OtherProps = Omit<ConfigProviderProps, 'chidlren'>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import './index.less';
2
+ declare function ErrorBoundary<T>({ err }: {
3
+ err?: T;
4
+ }): JSX.Element;
5
+ export default ErrorBoundary;
@@ -0,0 +1,39 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import * as React from 'react';
4
+ import classNames from 'classnames';
5
+ import "./index.less";
6
+ import { ConfigContext } from "../ConfigProvider";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+
10
+ function ErrorBoundary(_ref) {
11
+ var err = _ref.err;
12
+
13
+ var _React$useContext = React.useContext(ConfigContext),
14
+ prefixCls = _React$useContext.prefixCls,
15
+ getPrefixCls = _React$useContext.getPrefixCls;
16
+
17
+ var classname = getPrefixCls('error-boundary');
18
+ var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-error-boundary"), !!prefixCls), classname);
19
+
20
+ function refreshPage() {
21
+ window.location.reload();
22
+ }
23
+
24
+ return /*#__PURE__*/_jsxs("div", {
25
+ className: wrapperClass,
26
+ children: [/*#__PURE__*/_jsx("h2", {
27
+ children: "\u62B1\u6B49,\u7CFB\u7EDF\u51FA\u73B0\u95EE\u9898."
28
+ }), /*#__PURE__*/_jsx("div", {
29
+ className: "error-text",
30
+ children: err && JSON.stringify(err)
31
+ }), /*#__PURE__*/_jsx("div", {
32
+ className: "error-refresh",
33
+ onClick: refreshPage,
34
+ children: "\u91CD\u65B0\u5237\u65B0\u6D4F\u89C8\u5668"
35
+ })]
36
+ });
37
+ }
38
+
39
+ export default ErrorBoundary;
@@ -0,0 +1,42 @@
1
+ .pui-error-boundary {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ width: auto;
7
+ margin: 20px;
8
+ padding: 15px;
9
+ background-color: rgb(221, 127, 127);
10
+ border-radius: 10px;
11
+
12
+ .error-text {
13
+ margin-top: 20px;
14
+ }
15
+
16
+ .error-refresh {
17
+ width: 140px;
18
+ height: 40px;
19
+ color: white;
20
+ font-weight: bold;
21
+ line-height: 40px;
22
+ text-align: center;
23
+ background-color: #4593ef;
24
+ border-radius: 5px;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .errorDetiles {
29
+ .detilesLink {
30
+ color: blue;
31
+ }
32
+
33
+ .errordetails {
34
+ padding: 10px;
35
+ color: #777;
36
+ font-size: 80%;
37
+ background-color: rgb(204, 198, 190);
38
+ border: 1px solid #777;
39
+ border-radius: 5px;
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { LabelValue } from '@pointcloud/pui-components';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default (function () {
5
+ return /*#__PURE__*/_jsx(LabelValue, {
6
+ label: "\u59D3\u540D",
7
+ value: "Tom"
8
+ });
9
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { LabelValue } from '@pointcloud/pui-components';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default (function () {
5
+ return /*#__PURE__*/_jsx(LabelValue, {
6
+ label: "\u59D3\u540D",
7
+ value: "Tom",
8
+ noColon: true
9
+ });
10
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { LabelValue } from '@pointcloud/pui-components';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default (function () {
5
+ return /*#__PURE__*/_jsx(LabelValue, {
6
+ label: "\u59D3\u540D",
7
+ value: "",
8
+ emptyValue: "--"
9
+ });
10
+ });
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { LabelValueProps } from './interface';
3
+ import './styles/index.less';
4
+ declare function LabelValue({ label, value, emptyValue, className, noWrap, noColon }: LabelValueProps): JSX.Element;
5
+ declare namespace LabelValue {
6
+ var defaultProps: {
7
+ className: string;
8
+ label: string;
9
+ value: string;
10
+ emptyValue: string;
11
+ noWrap: boolean;
12
+ noColon: boolean;
13
+ };
14
+ }
15
+ declare const _default: React.MemoExoticComponent<typeof LabelValue>;
16
+ export default _default;
@@ -0,0 +1,45 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import React, { useContext } from 'react';
4
+ import classNames from 'classnames';
5
+ import { ConfigContext, defaultPrefixCls } from "../ConfigProvider";
6
+ import "./styles/index.less";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+
10
+ function LabelValue(_ref) {
11
+ var label = _ref.label,
12
+ value = _ref.value,
13
+ emptyValue = _ref.emptyValue,
14
+ className = _ref.className,
15
+ noWrap = _ref.noWrap,
16
+ noColon = _ref.noColon;
17
+
18
+ var _useContext = useContext(ConfigContext),
19
+ prefixCls = _useContext.prefixCls,
20
+ getPrefixCls = _useContext.getPrefixCls;
21
+
22
+ var classname = getPrefixCls('label-value');
23
+ var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-label-value"), !!prefixCls), classname, className);
24
+ return /*#__PURE__*/_jsxs("div", {
25
+ className: wrapperClass,
26
+ children: [/*#__PURE__*/_jsxs("span", {
27
+ className: "".concat(defaultPrefixCls, "-label"),
28
+ children: [label, noColon ? '' : ':']
29
+ }), /*#__PURE__*/_jsx("span", {
30
+ title: value,
31
+ className: "".concat(noWrap ? "".concat(defaultPrefixCls, "-value no-wrap") : "".concat(defaultPrefixCls, "-value")),
32
+ children: value || emptyValue || '暂无'
33
+ })]
34
+ });
35
+ }
36
+
37
+ LabelValue.defaultProps = {
38
+ className: '',
39
+ label: '',
40
+ value: '',
41
+ emptyValue: '-',
42
+ noWrap: false,
43
+ noColon: false
44
+ };
45
+ export default /*#__PURE__*/React.memo(LabelValue);
@@ -0,0 +1,29 @@
1
+ export interface LabelValueProps {
2
+ /**
3
+ * @description 文字标签
4
+ */
5
+ label: string | undefined;
6
+ /**
7
+ * @description 文字标签值
8
+ */
9
+ value?: string | undefined;
10
+ /**
11
+ * @description 文字标签值为空时的值
12
+ * @default -
13
+ */
14
+ emptyValue?: string | undefined;
15
+ /**
16
+ * @description 类名
17
+ */
18
+ className?: string;
19
+ /**
20
+ * @description 是否不换行
21
+ * @default false
22
+ */
23
+ noWrap?: boolean;
24
+ /**
25
+ * @description 是否隐藏冒号
26
+ * @default false
27
+ */
28
+ noColon?: boolean;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ .pui-label-value {
2
+ display: inline-flex;
3
+ span {
4
+ &:first-child {
5
+ max-width: 120px;
6
+ padding-right: 4px;
7
+ white-space: nowrap;
8
+ }
9
+ &:last-child {
10
+ flex: 1;
11
+ &.no-wrap {
12
+ overflow: hidden;
13
+ white-space: nowrap;
14
+ text-overflow: ellipsis;
15
+ }
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Button } from 'antd';
3
+ import { Loading } from '@pointcloud/pui-components';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export default (function () {
6
+ function onClick() {
7
+ Loading.open();
8
+ setTimeout(function () {
9
+ Loading.close();
10
+ }, 1000);
11
+ }
12
+
13
+ return /*#__PURE__*/_jsx(Button, {
14
+ onClick: onClick,
15
+ children: "\u63D0\u4EA4"
16
+ });
17
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Button } from 'antd';
3
+ import { Loading } from '@pointcloud/pui-components';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export default (function () {
6
+ function onClick() {
7
+ Loading.open('正在疯狂提交, 请耐心等待...');
8
+ setTimeout(function () {
9
+ Loading.close();
10
+ }, 2000);
11
+ }
12
+
13
+ return /*#__PURE__*/_jsx(Button, {
14
+ type: "primary",
15
+ onClick: onClick,
16
+ children: "\u786E\u8BA4"
17
+ });
18
+ });
@@ -0,0 +1,9 @@
1
+ import Loading from './loading';
2
+ import { LoadingProps } from './interface';
3
+ declare const _default: {
4
+ open(tip?: string | undefined): LoadingProps;
5
+ close(): void;
6
+ getInstance(): LoadingProps;
7
+ };
8
+ export default _default;
9
+ export { Loading };
@@ -0,0 +1,27 @@
1
+ import Loading from "./loading";
2
+ var loadingInstance = null;
3
+
4
+ var getLoadingInstance = function getLoadingInstance(tip) {
5
+ loadingInstance = loadingInstance || Loading.newInstance({
6
+ tip: tip
7
+ });
8
+ return loadingInstance;
9
+ };
10
+
11
+ export default {
12
+ open: function open(tip) {
13
+ return getLoadingInstance(tip);
14
+ },
15
+ close: function close() {
16
+ if (loadingInstance) {
17
+ var _loadingInstance;
18
+
19
+ (_loadingInstance = loadingInstance) === null || _loadingInstance === void 0 ? void 0 : _loadingInstance.destroy();
20
+ loadingInstance = null;
21
+ }
22
+ },
23
+ getInstance: function getInstance() {
24
+ return loadingInstance;
25
+ }
26
+ };
27
+ export { Loading };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface LoadingInstanceProps {
3
+ /**
4
+ * @description 加载的文字提示
5
+ * @default '数据请求中...'
6
+ */
7
+ tip?: string;
8
+ }
9
+ export interface LoadingProps {
10
+ open: (tip?: string) => React.ReactDOM;
11
+ close: () => void;
12
+ getInstance: () => React.ReactDOM;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { LoadingInstanceProps } from './interface';
2
+ import './styles/index.less';
3
+ declare function Loading(props: LoadingInstanceProps): JSX.Element;
4
+ declare namespace Loading {
5
+ var newInstance: <T extends LoadingInstanceProps>(args: T) => {
6
+ destroy(): void;
7
+ };
8
+ }
9
+ export default Loading;
@@ -0,0 +1,53 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ import React, { useContext } from 'react';
8
+ import ReactDOM from 'react-dom';
9
+ import { Spin } from 'antd';
10
+ import classNames from 'classnames';
11
+ import { ConfigContext } from "../ConfigProvider";
12
+ import "./styles/index.less";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
+
16
+ function Loading(props) {
17
+ var _props$tip = props.tip,
18
+ tip = _props$tip === void 0 ? '数据请求中...' : _props$tip;
19
+
20
+ var _useContext = useContext(ConfigContext),
21
+ prefixCls = _useContext.prefixCls,
22
+ getPrefixCls = _useContext.getPrefixCls;
23
+
24
+ var classname = getPrefixCls('loading');
25
+ var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-loading"), !!prefixCls), classname);
26
+ return /*#__PURE__*/_jsxs("div", {
27
+ className: wrapperClass,
28
+ children: [/*#__PURE__*/_jsx("div", {
29
+ className: "mask"
30
+ }), /*#__PURE__*/_jsx("div", {
31
+ className: "loading",
32
+ children: /*#__PURE__*/_jsx(Spin, {
33
+ tip: tip
34
+ })
35
+ })]
36
+ });
37
+ }
38
+
39
+ Loading.newInstance = function newNotificationInstance(args) {
40
+ var div = document.createElement('div');
41
+ document.body.appendChild(div);
42
+ ReactDOM.render( /*#__PURE__*/_jsx(Loading, _objectSpread({}, args)), div);
43
+ return {
44
+ destroy: function destroy() {
45
+ var _document$body;
46
+
47
+ ReactDOM.unmountComponentAtNode(div);
48
+ (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.removeChild(div);
49
+ }
50
+ };
51
+ };
52
+
53
+ export default Loading;
@@ -0,0 +1,22 @@
1
+ .pui-loading {
2
+ .mask {
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ z-index: 100000;
7
+ width: 100%;
8
+ height: 100%;
9
+ overflow: hidden;
10
+ }
11
+ .loading {
12
+ position: absolute;
13
+ top: 50%;
14
+ left: 50%;
15
+ z-index: 100001;
16
+ padding: 20px;
17
+ background: #fff;
18
+ border-radius: 10px;
19
+ box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
20
+ transform: translate(-50%, -50%);
21
+ }
22
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { NoData } from '@pointcloud/pui-components';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default (function () {
5
+ return /*#__PURE__*/_jsx("div", {
6
+ style: {
7
+ position: 'relative',
8
+ height: '200px'
9
+ },
10
+ children: /*#__PURE__*/_jsx(NoData, {})
11
+ });
12
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { NoData } from '@pointcloud/pui-components';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ export default (function () {
5
+ return /*#__PURE__*/_jsx("div", {
6
+ style: {
7
+ position: 'relative',
8
+ height: '200px'
9
+ },
10
+ children: /*#__PURE__*/_jsx(NoData, {
11
+ emptyText: "\u6570\u636E\u4E3A\u7A7A"
12
+ })
13
+ });
14
+ });
@@ -0,0 +1,4 @@
1
+ import { NoDataProps } from './interface';
2
+ import './styles/index.less';
3
+ declare const NoData: (props: NoDataProps) => JSX.Element;
4
+ export default NoData;