hc-busin-components 1.0.0

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 (185) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +53 -0
  3. package/dist/Actions/index.d.ts +20 -0
  4. package/dist/Actions/index.js +142 -0
  5. package/dist/Actions/index.less +9 -0
  6. package/dist/AuthComponents/authDivider.d.ts +15 -0
  7. package/dist/AuthComponents/authDivider.js +104 -0
  8. package/dist/AuthComponents/index.d.ts +4 -0
  9. package/dist/AuthComponents/index.js +14 -0
  10. package/dist/BasicFilesRead/images/back.png +0 -0
  11. package/dist/BasicFilesRead/images/excel.png +0 -0
  12. package/dist/BasicFilesRead/images/folder.png +0 -0
  13. package/dist/BasicFilesRead/images/image.png +0 -0
  14. package/dist/BasicFilesRead/images/jpeg.png +0 -0
  15. package/dist/BasicFilesRead/images/jpg.png +0 -0
  16. package/dist/BasicFilesRead/images/normal.png +0 -0
  17. package/dist/BasicFilesRead/images/png.png +0 -0
  18. package/dist/BasicFilesRead/images/tar.png +0 -0
  19. package/dist/BasicFilesRead/images/text.png +0 -0
  20. package/dist/BasicFilesRead/images/zip.png +0 -0
  21. package/dist/BasicFilesRead/index.d.ts +31 -0
  22. package/dist/BasicFilesRead/index.js +286 -0
  23. package/dist/BasicFilesRead/styles/index.d.ts +3 -0
  24. package/dist/BasicFilesRead/styles/index.js +9 -0
  25. package/dist/CombinTable/components/RenderContent.d.ts +9 -0
  26. package/dist/CombinTable/components/RenderContent.js +201 -0
  27. package/dist/CombinTable/hooks/useTableParams.d.ts +20 -0
  28. package/dist/CombinTable/hooks/useTableParams.js +75 -0
  29. package/dist/CombinTable/hooks/useTableState.d.ts +5 -0
  30. package/dist/CombinTable/hooks/useTableState.js +22 -0
  31. package/dist/CombinTable/index.d.ts +4 -0
  32. package/dist/CombinTable/index.js +225 -0
  33. package/dist/CombinTable/styles/index.d.ts +3 -0
  34. package/dist/CombinTable/styles/index.js +11 -0
  35. package/dist/CombinTable/types/index.d.ts +21 -0
  36. package/dist/CombinTable/types/index.js +1 -0
  37. package/dist/CombineSearch/components/Content.d.ts +13 -0
  38. package/dist/CombineSearch/components/Content.js +249 -0
  39. package/dist/CombineSearch/components/Tags.d.ts +14 -0
  40. package/dist/CombineSearch/components/Tags.js +115 -0
  41. package/dist/CombineSearch/hooks/useCombineState.d.ts +5 -0
  42. package/dist/CombineSearch/hooks/useCombineState.js +17 -0
  43. package/dist/CombineSearch/index.d.ts +4 -0
  44. package/dist/CombineSearch/index.js +168 -0
  45. package/dist/CombineSearch/style/edit.svg +1 -0
  46. package/dist/CombineSearch/style/index.d.ts +14 -0
  47. package/dist/CombineSearch/style/index.js +26 -0
  48. package/dist/CombineSearch/types/index.d.ts +46 -0
  49. package/dist/CombineSearch/types/index.js +0 -0
  50. package/dist/ComponentUninstalled/assets/comp-unintall-background.png +0 -0
  51. package/dist/ComponentUninstalled/assets/comp-unintall-bg.png +0 -0
  52. package/dist/ComponentUninstalled/index.d.ts +32 -0
  53. package/dist/ComponentUninstalled/index.js +164 -0
  54. package/dist/ComponentUninstalled/index.less +108 -0
  55. package/dist/ComponentUninstalled/locale.d.ts +14 -0
  56. package/dist/ComponentUninstalled/locale.js +21 -0
  57. package/dist/DataCountPopover/index.d.ts +23 -0
  58. package/dist/DataCountPopover/index.js +121 -0
  59. package/dist/DataCountPopover/index.less +62 -0
  60. package/dist/DateRangePicker/index.d.ts +38 -0
  61. package/dist/DateRangePicker/index.js +483 -0
  62. package/dist/DateRangePicker/index.less +196 -0
  63. package/dist/DeleteConfirm/index.d.ts +23 -0
  64. package/dist/DeleteConfirm/index.js +109 -0
  65. package/dist/DeleteConfirm/index.less +44 -0
  66. package/dist/DeleteConfirm/locale.d.ts +7 -0
  67. package/dist/DeleteConfirm/locale.js +7 -0
  68. package/dist/DisplayButton/index.d.ts +7 -0
  69. package/dist/DisplayButton/index.js +23 -0
  70. package/dist/FileRead/images/back.png +0 -0
  71. package/dist/FileRead/images/excel.png +0 -0
  72. package/dist/FileRead/images/folder.png +0 -0
  73. package/dist/FileRead/images/image.png +0 -0
  74. package/dist/FileRead/images/jpeg.png +0 -0
  75. package/dist/FileRead/images/jpg.png +0 -0
  76. package/dist/FileRead/images/normal.png +0 -0
  77. package/dist/FileRead/images/png.png +0 -0
  78. package/dist/FileRead/images/tar.png +0 -0
  79. package/dist/FileRead/images/text.png +0 -0
  80. package/dist/FileRead/images/zip.png +0 -0
  81. package/dist/FileRead/index.d.ts +31 -0
  82. package/dist/FileRead/index.js +417 -0
  83. package/dist/FileRead/styles/index.d.ts +3 -0
  84. package/dist/FileRead/styles/index.js +9 -0
  85. package/dist/Icon/iconfont.d.ts +1 -0
  86. package/dist/Icon/iconfont.js +1 -0
  87. package/dist/Icon/index.d.ts +10 -0
  88. package/dist/Icon/index.js +20 -0
  89. package/dist/Icon/index.less +11 -0
  90. package/dist/IconPopTips/index.d.ts +10 -0
  91. package/dist/IconPopTips/index.js +26 -0
  92. package/dist/IconPopTips/index.less +33 -0
  93. package/dist/IconText/index.d.ts +15 -0
  94. package/dist/IconText/index.js +19 -0
  95. package/dist/IconText/index.less +38 -0
  96. package/dist/LogCenter/assets/empty.png +0 -0
  97. package/dist/LogCenter/context.d.ts +24 -0
  98. package/dist/LogCenter/context.js +66 -0
  99. package/dist/LogCenter/history-log.d.ts +35 -0
  100. package/dist/LogCenter/history-log.js +1214 -0
  101. package/dist/LogCenter/index.d.ts +8 -0
  102. package/dist/LogCenter/index.js +130 -0
  103. package/dist/LogCenter/index.less +577 -0
  104. package/dist/LogCenter/locale.d.ts +3 -0
  105. package/dist/LogCenter/locale.js +81 -0
  106. package/dist/LogCenter/realtime-log.d.ts +35 -0
  107. package/dist/LogCenter/realtime-log.js +641 -0
  108. package/dist/LogCenter/select-with-all.d.ts +28 -0
  109. package/dist/LogCenter/select-with-all.js +337 -0
  110. package/dist/LogCenter/select-with-all.less +81 -0
  111. package/dist/LogCenter/services.d.ts +27 -0
  112. package/dist/LogCenter/services.js +93 -0
  113. package/dist/LogCenter/tools.d.ts +9 -0
  114. package/dist/LogCenter/tools.js +137 -0
  115. package/dist/LogCenter/types.d.ts +133 -0
  116. package/dist/LogCenter/types.js +1 -0
  117. package/dist/LogicalResourceFilter/index.d.ts +7 -0
  118. package/dist/LogicalResourceFilter/index.js +426 -0
  119. package/dist/LogicalResourceFilter/index.less +139 -0
  120. package/dist/LogicalResourceFilter/locale.d.ts +2 -0
  121. package/dist/LogicalResourceFilter/locale.js +10 -0
  122. package/dist/LogicalResourceFilter/types.d.ts +58 -0
  123. package/dist/LogicalResourceFilter/types.js +1 -0
  124. package/dist/MetadataCount/index.d.ts +16 -0
  125. package/dist/MetadataCount/index.js +97 -0
  126. package/dist/MetadataCount/index.less +40 -0
  127. package/dist/MetadataForm/index.d.ts +18 -0
  128. package/dist/MetadataForm/index.js +85 -0
  129. package/dist/MetadataForm/index.less +108 -0
  130. package/dist/MetadataForm/label.d.ts +13 -0
  131. package/dist/MetadataForm/label.js +447 -0
  132. package/dist/MetadataPopoverList/fetchArray.d.ts +3 -0
  133. package/dist/MetadataPopoverList/fetchArray.js +74 -0
  134. package/dist/MetadataPopoverList/index.d.ts +13 -0
  135. package/dist/MetadataPopoverList/index.js +98 -0
  136. package/dist/MetadataPopoverList/index.less +74 -0
  137. package/dist/MetadataTags/index.d.ts +17 -0
  138. package/dist/MetadataTags/index.js +109 -0
  139. package/dist/MetadataTags/index.less +26 -0
  140. package/dist/OverFlow/index.d.ts +4 -0
  141. package/dist/OverFlow/index.js +66 -0
  142. package/dist/OverFlow/types/index.d.ts +11 -0
  143. package/dist/OverFlow/types/index.js +1 -0
  144. package/dist/PageHeader/index.d.ts +16 -0
  145. package/dist/PageHeader/index.js +41 -0
  146. package/dist/PageHeader/index.less +89 -0
  147. package/dist/ResourceProgress/index.d.ts +6 -0
  148. package/dist/ResourceProgress/index.js +102 -0
  149. package/dist/ResourceProgress/index.less +86 -0
  150. package/dist/ResourceProgress/types/index.d.ts +15 -0
  151. package/dist/ResourceProgress/types/index.js +1 -0
  152. package/dist/Terminal/index.d.ts +44 -0
  153. package/dist/Terminal/index.js +390 -0
  154. package/dist/Terminal/index.less +39 -0
  155. package/dist/TextCopy/index.d.ts +21 -0
  156. package/dist/TextCopy/index.js +38 -0
  157. package/dist/TextCopy/index.less +51 -0
  158. package/dist/TextEllipsis/index.d.ts +18 -0
  159. package/dist/TextEllipsis/index.js +31 -0
  160. package/dist/TextEllipsis/index.less +3 -0
  161. package/dist/ThemeForm/index.d.ts +6 -0
  162. package/dist/ThemeForm/index.js +15 -0
  163. package/dist/ThemeForm/index.less +15 -0
  164. package/dist/ThemeSubmit/index.d.ts +16 -0
  165. package/dist/ThemeSubmit/index.js +60 -0
  166. package/dist/ThemeSubmit/index.less +30 -0
  167. package/dist/TooltipSpan/index.d.ts +6 -0
  168. package/dist/TooltipSpan/index.js +72 -0
  169. package/dist/UsageCycle/index.d.ts +12 -0
  170. package/dist/UsageCycle/index.js +71 -0
  171. package/dist/UsageCycle/index.less +56 -0
  172. package/dist/Yaml/CodeMirrorWrapper.d.ts +14 -0
  173. package/dist/Yaml/CodeMirrorWrapper.js +106 -0
  174. package/dist/Yaml/index.d.ts +6 -0
  175. package/dist/Yaml/index.js +470 -0
  176. package/dist/Yaml/index.less +190 -0
  177. package/dist/Yaml/types.d.ts +38 -0
  178. package/dist/Yaml/types.js +1 -0
  179. package/dist/index.d.ts +52 -0
  180. package/dist/index.js +32 -0
  181. package/dist/metadata/locale.d.ts +52 -0
  182. package/dist/metadata/locale.js +69 -0
  183. package/dist/showMore/index.d.ts +6 -0
  184. package/dist/showMore/index.js +40 -0
  185. package/package.json +121 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # hc-busin-components
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/hc-busin-components.svg?style=flat)](https://npmjs.org/package/hc-busin-components)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/hc-busin-components.svg?style=flat)](https://npmjs.org/package/hc-busin-components)
5
+
6
+ A react library developed with dumi
7
+
8
+ ## Usage
9
+
10
+ TODO
11
+
12
+ ## Options
13
+
14
+ TODO
15
+
16
+ ## Development
17
+
18
+ ```bash
19
+ # install dependencies
20
+ $ yarn install
21
+
22
+ # develop library by docs demo
23
+ $ yarn start
24
+
25
+ # build library source code
26
+ $ yarn run build
27
+
28
+ # build library source code in watch mode
29
+ $ yarn run build:watch
30
+
31
+ # build docs
32
+ $ yarn run docs:build
33
+
34
+ # Locally preview the production build.
35
+ $ yarn run docs:preview
36
+
37
+ # check your project for potential problems
38
+ $ yarn run doctor
39
+ ```
40
+
41
+ 若文档开发报错 `Can't resolve './core/defineApp' in '.dumi/tmp'`,说明 Dumi 临时目录不完整。可先清理再生成:
42
+
43
+ ```bash
44
+ rm -rf .dumi/tmp .dumi/tmp-production .dumi/tmp-test
45
+ yarn dumi setup # 或 npx dumi setup
46
+ yarn start
47
+ ```
48
+
49
+ (`yarn start` / `docs:build` 已会在执行前自动运行 `dumi setup`。)
50
+
51
+ ## LICENSE
52
+
53
+ MIT
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface ActionElementProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ onClick?: () => void;
5
+ disabled?: boolean;
6
+ children?: React.ReactNode;
7
+ }
8
+ export interface ActionsProps {
9
+ children: React.ReactNode[] | React.ReactNode;
10
+ /** 行内最多展示的按钮数量,超出部分收入「更多」 */
11
+ threshold?: number;
12
+ }
13
+ export interface LinkButtonProps extends React.HTMLAttributes<HTMLSpanElement> {
14
+ disabled?: boolean;
15
+ children?: React.ReactNode;
16
+ onClick?: () => void;
17
+ }
18
+ declare const LinkButton: React.FC<LinkButtonProps>;
19
+ declare const Actions: React.FC<ActionsProps>;
20
+ export { Actions, LinkButton };
@@ -0,0 +1,142 @@
1
+ var _excluded = ["disabled", "children", "onClick", "style"],
2
+ _excluded2 = ["onClick", "disabled", "children"],
3
+ _excluded3 = ["onClick", "disabled", "style", "children"],
4
+ _excluded4 = ["onClick", "disabled", "children"];
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
+ import { MoreOutlined } from '@ant-design/icons';
15
+ import { Divider, Dropdown, Space } from 'antd';
16
+ import React, { useEffect, useState } from 'react';
17
+ import "./index.less";
18
+ var LinkButton = function LinkButton(_ref) {
19
+ var _ref$disabled = _ref.disabled,
20
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
21
+ linkChildren = _ref.children,
22
+ onClick = _ref.onClick,
23
+ style = _ref.style,
24
+ args = _objectWithoutProperties(_ref, _excluded);
25
+ return /*#__PURE__*/React.createElement("span", _extends({
26
+ style: style,
27
+ className: disabled ? 'displayed-name' : 'name-link',
28
+ onClick: disabled ? undefined : onClick
29
+ }, args), linkChildren);
30
+ };
31
+ var Actions = function Actions(_ref2) {
32
+ var children = _ref2.children,
33
+ _ref2$threshold = _ref2.threshold,
34
+ threshold = _ref2$threshold === void 0 ? 3 : _ref2$threshold;
35
+ var _useState = useState([]),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ list = _useState2[0],
38
+ setList = _useState2[1];
39
+ useEffect(function () {
40
+ if (!children) {
41
+ setList([]);
42
+ return;
43
+ }
44
+ if (Array.isArray(children)) {
45
+ var lt = children.filter(function (item) {
46
+ return item !== null && typeof item !== 'boolean' && /*#__PURE__*/React.isValidElement(item);
47
+ });
48
+ setList(lt);
49
+ } else if ( /*#__PURE__*/React.isValidElement(children) && children.props.children) {
50
+ setList([children]);
51
+ } else {
52
+ setList([]);
53
+ }
54
+ }, [children]);
55
+ if (list.length <= threshold) {
56
+ return /*#__PURE__*/React.createElement(Space, {
57
+ align: "center",
58
+ style: {
59
+ gap: 0
60
+ },
61
+ split: /*#__PURE__*/React.createElement(Divider, {
62
+ type: "vertical"
63
+ })
64
+ }, list.map(function (item, index) {
65
+ var _item$props = item.props,
66
+ onClick = _item$props.onClick,
67
+ _item$props$disabled = _item$props.disabled,
68
+ disabled = _item$props$disabled === void 0 ? false : _item$props$disabled,
69
+ linkChildren = _item$props.children,
70
+ rest = _objectWithoutProperties(_item$props, _excluded2);
71
+ return /*#__PURE__*/React.createElement(LinkButton, _extends({
72
+ key: index,
73
+ onClick: onClick,
74
+ disabled: disabled
75
+ }, rest), linkChildren);
76
+ }));
77
+ }
78
+ var l1 = list.slice(0, threshold);
79
+ var l2 = list.slice(threshold);
80
+ var items = l2.map(function (item, index) {
81
+ var _item$props2 = item.props,
82
+ onClick = _item$props2.onClick,
83
+ _item$props2$disabled = _item$props2.disabled,
84
+ disabled = _item$props2$disabled === void 0 ? false : _item$props2$disabled,
85
+ style = _item$props2.style,
86
+ labelChildren = _item$props2.children,
87
+ rest = _objectWithoutProperties(_item$props2, _excluded3);
88
+ void onClick;
89
+ return {
90
+ key: String(index),
91
+ disabled: disabled,
92
+ label: /*#__PURE__*/React.createElement("span", _extends({
93
+ className: disabled ? 'displayed-name' : '',
94
+ style: style
95
+ }, rest), labelChildren)
96
+ };
97
+ });
98
+ var onMenuClick = function onMenuClick(_ref3) {
99
+ var key = _ref3.key,
100
+ domEvent = _ref3.domEvent;
101
+ domEvent === null || domEvent === void 0 || domEvent.stopPropagation();
102
+ var idx = Number(key);
103
+ var item = l2[idx];
104
+ if (item && !item.props.disabled) {
105
+ var _item$props$onClick, _item$props3;
106
+ (_item$props$onClick = (_item$props3 = item.props).onClick) === null || _item$props$onClick === void 0 || _item$props$onClick.call(_item$props3);
107
+ }
108
+ };
109
+ return /*#__PURE__*/React.createElement(Space, {
110
+ align: "center",
111
+ style: {
112
+ gap: 0
113
+ },
114
+ split: /*#__PURE__*/React.createElement(Divider, {
115
+ type: "vertical"
116
+ })
117
+ }, l1.map(function (item, index) {
118
+ var _item$props4 = item.props,
119
+ onClick = _item$props4.onClick,
120
+ _item$props4$disabled = _item$props4.disabled,
121
+ disabled = _item$props4$disabled === void 0 ? false : _item$props4$disabled,
122
+ linkChildren = _item$props4.children,
123
+ rest = _objectWithoutProperties(_item$props4, _excluded4);
124
+ return /*#__PURE__*/React.createElement(LinkButton, _extends({
125
+ key: index,
126
+ onClick: onClick,
127
+ disabled: disabled
128
+ }, rest), linkChildren);
129
+ }), /*#__PURE__*/React.createElement(Dropdown, {
130
+ trigger: ['click'],
131
+ menu: {
132
+ items: items,
133
+ onClick: onMenuClick
134
+ }
135
+ }, /*#__PURE__*/React.createElement(MoreOutlined, {
136
+ style: {
137
+ fontSize: 12,
138
+ cursor: 'pointer'
139
+ }
140
+ })));
141
+ };
142
+ export { Actions, LinkButton };
@@ -0,0 +1,9 @@
1
+ .name-link {
2
+ color: var(--ant-color-link);
3
+ cursor: pointer;
4
+ }
5
+
6
+ .displayed-name {
7
+ color: var(--ant-color-text-disabled);
8
+ cursor: not-allowed;
9
+ }
@@ -0,0 +1,15 @@
1
+ import { ButtonProps } from 'antd';
2
+ import React from 'react';
3
+ interface AuthType {
4
+ accType: string;
5
+ createor?: boolean;
6
+ statusDisabled?: boolean;
7
+ adminOperation?: boolean;
8
+ oner?: boolean;
9
+ gap?: boolean;
10
+ tip?: string;
11
+ haveAuth?: boolean;
12
+ }
13
+ type Props = ButtonProps & AuthType;
14
+ declare const AuthDividerButton: (props: Props) => React.JSX.Element;
15
+ export default AuthDividerButton;
@@ -0,0 +1,104 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["haveAuth", "accType", "tip", "statusDisabled", "createor", "oner", "adminOperation", "gap"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ import { Button, Divider, Space } from 'antd';
12
+ import DisPlayButton from "../DisplayButton";
13
+ import React from 'react';
14
+ var AuthDividerButton = function AuthDividerButton(props) {
15
+ var haveAuth = props.haveAuth,
16
+ accType = props.accType,
17
+ tip = props.tip,
18
+ statusDisabled = props.statusDisabled,
19
+ createor = props.createor,
20
+ oner = props.oner,
21
+ _props$adminOperation = props.adminOperation,
22
+ adminOperation = _props$adminOperation === void 0 ? true : _props$adminOperation,
23
+ _props$gap = props.gap,
24
+ gap = _props$gap === void 0 ? true : _props$gap,
25
+ btnProps = _objectWithoutProperties(props, _excluded);
26
+ var inStyles = _objectSpread({
27
+ padding: 0,
28
+ fontSize: '12px'
29
+ }, btnProps.style);
30
+ if (haveAuth) {
31
+ if (statusDisabled) {
32
+ return /*#__PURE__*/React.createElement(Space, {
33
+ align: "center",
34
+ size: [0, 0]
35
+ }, /*#__PURE__*/React.createElement(DisPlayButton, {
36
+ text: btnProps.children,
37
+ style: inStyles,
38
+ tip: "\u5F53\u524D\u72B6\u6001\u4E0D\u53EF\u64CD\u4F5C"
39
+ }), gap ? /*#__PURE__*/React.createElement(Divider, {
40
+ type: "vertical"
41
+ }) : null);
42
+ }
43
+ if (adminOperation) {
44
+ return /*#__PURE__*/React.createElement(Space, {
45
+ align: "center",
46
+ size: [0, 0]
47
+ }, /*#__PURE__*/React.createElement(Button, _extends({
48
+ type: "link",
49
+ size: "small"
50
+ }, btnProps, {
51
+ style: inStyles
52
+ }), btnProps.children), gap ? /*#__PURE__*/React.createElement(Divider, {
53
+ type: "vertical"
54
+ }) : null);
55
+ }
56
+ if (oner) {
57
+ return /*#__PURE__*/React.createElement(Space, {
58
+ align: "center",
59
+ size: [0, 0]
60
+ }, /*#__PURE__*/React.createElement(Button, _extends({
61
+ size: "small",
62
+ type: "link"
63
+ }, btnProps, {
64
+ style: inStyles
65
+ }), btnProps.children), gap ? /*#__PURE__*/React.createElement(Divider, {
66
+ type: "vertical"
67
+ }) : null);
68
+ }
69
+ if (createor) {
70
+ return /*#__PURE__*/React.createElement(Space, {
71
+ align: "center",
72
+ size: [0, 0]
73
+ }, /*#__PURE__*/React.createElement(Button, _extends({
74
+ type: "link",
75
+ size: "small"
76
+ }, btnProps, {
77
+ style: inStyles
78
+ }), btnProps.children), gap ? /*#__PURE__*/React.createElement(Divider, {
79
+ type: "vertical"
80
+ }) : null);
81
+ }
82
+ return /*#__PURE__*/React.createElement(Space, {
83
+ align: "center",
84
+ size: [0, 0]
85
+ }, /*#__PURE__*/React.createElement(DisPlayButton, {
86
+ text: btnProps.children,
87
+ style: inStyles,
88
+ tip: tip ? tip : "只有创建者和组织管理员可以操作"
89
+ }), gap ? /*#__PURE__*/React.createElement(Divider, {
90
+ type: "vertical"
91
+ }) : null);
92
+ }
93
+ return /*#__PURE__*/React.createElement(Space, {
94
+ align: "center",
95
+ size: [0, 0]
96
+ }, /*#__PURE__*/React.createElement(DisPlayButton, {
97
+ text: btnProps.children,
98
+ style: inStyles,
99
+ tip: "\u5F53\u524D\u7528\u6237\u65E0\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650"
100
+ }), gap ? /*#__PURE__*/React.createElement(Divider, {
101
+ type: "vertical"
102
+ }) : null);
103
+ };
104
+ export default AuthDividerButton;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export type HOC = <P extends {}>(Components: React.ComponentType<P>, componentType: any, haveAuth?: boolean) => (props: P) => JSX.Element | null;
3
+ declare const AuthComponent: HOC;
4
+ export default AuthComponent;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ var AuthComponent = function AuthComponent(Components, componentType, haveAuth) {
3
+ return function (props) {
4
+ try {
5
+ if (haveAuth) {
6
+ return /*#__PURE__*/React.createElement(Components, props);
7
+ }
8
+ return null;
9
+ } catch (_unused) {
10
+ return null;
11
+ }
12
+ };
13
+ };
14
+ export default AuthComponent;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ data: any[];
4
+ onClickPath: (path: string, allpath: any[]) => void;
5
+ fieldNames: string[];
6
+ fieldVisible?: {
7
+ dataIndex: string;
8
+ visibleKey: string;
9
+ visibleValue: any;
10
+ }[];
11
+ loading?: boolean;
12
+ multiple?: boolean;
13
+ tools?: {
14
+ multiple: boolean;
15
+ DOM: React.ReactNode;
16
+ }[];
17
+ operations: {
18
+ key: string;
19
+ title: string;
20
+ displayKey?: string;
21
+ displayValue?: any;
22
+ type?: 'danger' | 'link' | undefined;
23
+ dangerTip?: string;
24
+ showKey?: string;
25
+ render?: (record: any, allPath?: string[], isFileTools?: boolean) => React.ReactNode;
26
+ onClick?: (record: any, allPath?: string[]) => void;
27
+ }[];
28
+ customColumnsRender?: any;
29
+ }
30
+ declare const FileRead: React.ForwardRefExoticComponent<Props & React.RefAttributes<unknown>>;
31
+ export default FileRead;