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.
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/Actions/index.d.ts +20 -0
- package/dist/Actions/index.js +142 -0
- package/dist/Actions/index.less +9 -0
- package/dist/AuthComponents/authDivider.d.ts +15 -0
- package/dist/AuthComponents/authDivider.js +104 -0
- package/dist/AuthComponents/index.d.ts +4 -0
- package/dist/AuthComponents/index.js +14 -0
- package/dist/BasicFilesRead/images/back.png +0 -0
- package/dist/BasicFilesRead/images/excel.png +0 -0
- package/dist/BasicFilesRead/images/folder.png +0 -0
- package/dist/BasicFilesRead/images/image.png +0 -0
- package/dist/BasicFilesRead/images/jpeg.png +0 -0
- package/dist/BasicFilesRead/images/jpg.png +0 -0
- package/dist/BasicFilesRead/images/normal.png +0 -0
- package/dist/BasicFilesRead/images/png.png +0 -0
- package/dist/BasicFilesRead/images/tar.png +0 -0
- package/dist/BasicFilesRead/images/text.png +0 -0
- package/dist/BasicFilesRead/images/zip.png +0 -0
- package/dist/BasicFilesRead/index.d.ts +31 -0
- package/dist/BasicFilesRead/index.js +286 -0
- package/dist/BasicFilesRead/styles/index.d.ts +3 -0
- package/dist/BasicFilesRead/styles/index.js +9 -0
- package/dist/CombinTable/components/RenderContent.d.ts +9 -0
- package/dist/CombinTable/components/RenderContent.js +201 -0
- package/dist/CombinTable/hooks/useTableParams.d.ts +20 -0
- package/dist/CombinTable/hooks/useTableParams.js +75 -0
- package/dist/CombinTable/hooks/useTableState.d.ts +5 -0
- package/dist/CombinTable/hooks/useTableState.js +22 -0
- package/dist/CombinTable/index.d.ts +4 -0
- package/dist/CombinTable/index.js +225 -0
- package/dist/CombinTable/styles/index.d.ts +3 -0
- package/dist/CombinTable/styles/index.js +11 -0
- package/dist/CombinTable/types/index.d.ts +21 -0
- package/dist/CombinTable/types/index.js +1 -0
- package/dist/CombineSearch/components/Content.d.ts +13 -0
- package/dist/CombineSearch/components/Content.js +249 -0
- package/dist/CombineSearch/components/Tags.d.ts +14 -0
- package/dist/CombineSearch/components/Tags.js +115 -0
- package/dist/CombineSearch/hooks/useCombineState.d.ts +5 -0
- package/dist/CombineSearch/hooks/useCombineState.js +17 -0
- package/dist/CombineSearch/index.d.ts +4 -0
- package/dist/CombineSearch/index.js +168 -0
- package/dist/CombineSearch/style/edit.svg +1 -0
- package/dist/CombineSearch/style/index.d.ts +14 -0
- package/dist/CombineSearch/style/index.js +26 -0
- package/dist/CombineSearch/types/index.d.ts +46 -0
- package/dist/CombineSearch/types/index.js +0 -0
- package/dist/ComponentUninstalled/assets/comp-unintall-background.png +0 -0
- package/dist/ComponentUninstalled/assets/comp-unintall-bg.png +0 -0
- package/dist/ComponentUninstalled/index.d.ts +32 -0
- package/dist/ComponentUninstalled/index.js +164 -0
- package/dist/ComponentUninstalled/index.less +108 -0
- package/dist/ComponentUninstalled/locale.d.ts +14 -0
- package/dist/ComponentUninstalled/locale.js +21 -0
- package/dist/DataCountPopover/index.d.ts +23 -0
- package/dist/DataCountPopover/index.js +121 -0
- package/dist/DataCountPopover/index.less +62 -0
- package/dist/DateRangePicker/index.d.ts +38 -0
- package/dist/DateRangePicker/index.js +483 -0
- package/dist/DateRangePicker/index.less +196 -0
- package/dist/DeleteConfirm/index.d.ts +23 -0
- package/dist/DeleteConfirm/index.js +109 -0
- package/dist/DeleteConfirm/index.less +44 -0
- package/dist/DeleteConfirm/locale.d.ts +7 -0
- package/dist/DeleteConfirm/locale.js +7 -0
- package/dist/DisplayButton/index.d.ts +7 -0
- package/dist/DisplayButton/index.js +23 -0
- package/dist/FileRead/images/back.png +0 -0
- package/dist/FileRead/images/excel.png +0 -0
- package/dist/FileRead/images/folder.png +0 -0
- package/dist/FileRead/images/image.png +0 -0
- package/dist/FileRead/images/jpeg.png +0 -0
- package/dist/FileRead/images/jpg.png +0 -0
- package/dist/FileRead/images/normal.png +0 -0
- package/dist/FileRead/images/png.png +0 -0
- package/dist/FileRead/images/tar.png +0 -0
- package/dist/FileRead/images/text.png +0 -0
- package/dist/FileRead/images/zip.png +0 -0
- package/dist/FileRead/index.d.ts +31 -0
- package/dist/FileRead/index.js +417 -0
- package/dist/FileRead/styles/index.d.ts +3 -0
- package/dist/FileRead/styles/index.js +9 -0
- package/dist/Icon/iconfont.d.ts +1 -0
- package/dist/Icon/iconfont.js +1 -0
- package/dist/Icon/index.d.ts +10 -0
- package/dist/Icon/index.js +20 -0
- package/dist/Icon/index.less +11 -0
- package/dist/IconPopTips/index.d.ts +10 -0
- package/dist/IconPopTips/index.js +26 -0
- package/dist/IconPopTips/index.less +33 -0
- package/dist/IconText/index.d.ts +15 -0
- package/dist/IconText/index.js +19 -0
- package/dist/IconText/index.less +38 -0
- package/dist/LogCenter/assets/empty.png +0 -0
- package/dist/LogCenter/context.d.ts +24 -0
- package/dist/LogCenter/context.js +66 -0
- package/dist/LogCenter/history-log.d.ts +35 -0
- package/dist/LogCenter/history-log.js +1214 -0
- package/dist/LogCenter/index.d.ts +8 -0
- package/dist/LogCenter/index.js +130 -0
- package/dist/LogCenter/index.less +577 -0
- package/dist/LogCenter/locale.d.ts +3 -0
- package/dist/LogCenter/locale.js +81 -0
- package/dist/LogCenter/realtime-log.d.ts +35 -0
- package/dist/LogCenter/realtime-log.js +641 -0
- package/dist/LogCenter/select-with-all.d.ts +28 -0
- package/dist/LogCenter/select-with-all.js +337 -0
- package/dist/LogCenter/select-with-all.less +81 -0
- package/dist/LogCenter/services.d.ts +27 -0
- package/dist/LogCenter/services.js +93 -0
- package/dist/LogCenter/tools.d.ts +9 -0
- package/dist/LogCenter/tools.js +137 -0
- package/dist/LogCenter/types.d.ts +133 -0
- package/dist/LogCenter/types.js +1 -0
- package/dist/LogicalResourceFilter/index.d.ts +7 -0
- package/dist/LogicalResourceFilter/index.js +426 -0
- package/dist/LogicalResourceFilter/index.less +139 -0
- package/dist/LogicalResourceFilter/locale.d.ts +2 -0
- package/dist/LogicalResourceFilter/locale.js +10 -0
- package/dist/LogicalResourceFilter/types.d.ts +58 -0
- package/dist/LogicalResourceFilter/types.js +1 -0
- package/dist/MetadataCount/index.d.ts +16 -0
- package/dist/MetadataCount/index.js +97 -0
- package/dist/MetadataCount/index.less +40 -0
- package/dist/MetadataForm/index.d.ts +18 -0
- package/dist/MetadataForm/index.js +85 -0
- package/dist/MetadataForm/index.less +108 -0
- package/dist/MetadataForm/label.d.ts +13 -0
- package/dist/MetadataForm/label.js +447 -0
- package/dist/MetadataPopoverList/fetchArray.d.ts +3 -0
- package/dist/MetadataPopoverList/fetchArray.js +74 -0
- package/dist/MetadataPopoverList/index.d.ts +13 -0
- package/dist/MetadataPopoverList/index.js +98 -0
- package/dist/MetadataPopoverList/index.less +74 -0
- package/dist/MetadataTags/index.d.ts +17 -0
- package/dist/MetadataTags/index.js +109 -0
- package/dist/MetadataTags/index.less +26 -0
- package/dist/OverFlow/index.d.ts +4 -0
- package/dist/OverFlow/index.js +66 -0
- package/dist/OverFlow/types/index.d.ts +11 -0
- package/dist/OverFlow/types/index.js +1 -0
- package/dist/PageHeader/index.d.ts +16 -0
- package/dist/PageHeader/index.js +41 -0
- package/dist/PageHeader/index.less +89 -0
- package/dist/ResourceProgress/index.d.ts +6 -0
- package/dist/ResourceProgress/index.js +102 -0
- package/dist/ResourceProgress/index.less +86 -0
- package/dist/ResourceProgress/types/index.d.ts +15 -0
- package/dist/ResourceProgress/types/index.js +1 -0
- package/dist/Terminal/index.d.ts +44 -0
- package/dist/Terminal/index.js +390 -0
- package/dist/Terminal/index.less +39 -0
- package/dist/TextCopy/index.d.ts +21 -0
- package/dist/TextCopy/index.js +38 -0
- package/dist/TextCopy/index.less +51 -0
- package/dist/TextEllipsis/index.d.ts +18 -0
- package/dist/TextEllipsis/index.js +31 -0
- package/dist/TextEllipsis/index.less +3 -0
- package/dist/ThemeForm/index.d.ts +6 -0
- package/dist/ThemeForm/index.js +15 -0
- package/dist/ThemeForm/index.less +15 -0
- package/dist/ThemeSubmit/index.d.ts +16 -0
- package/dist/ThemeSubmit/index.js +60 -0
- package/dist/ThemeSubmit/index.less +30 -0
- package/dist/TooltipSpan/index.d.ts +6 -0
- package/dist/TooltipSpan/index.js +72 -0
- package/dist/UsageCycle/index.d.ts +12 -0
- package/dist/UsageCycle/index.js +71 -0
- package/dist/UsageCycle/index.less +56 -0
- package/dist/Yaml/CodeMirrorWrapper.d.ts +14 -0
- package/dist/Yaml/CodeMirrorWrapper.js +106 -0
- package/dist/Yaml/index.d.ts +6 -0
- package/dist/Yaml/index.js +470 -0
- package/dist/Yaml/index.less +190 -0
- package/dist/Yaml/types.d.ts +38 -0
- package/dist/Yaml/types.js +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +32 -0
- package/dist/metadata/locale.d.ts +52 -0
- package/dist/metadata/locale.js +69 -0
- package/dist/showMore/index.d.ts +6 -0
- package/dist/showMore/index.js +40 -0
- package/package.json +121 -0
|
@@ -0,0 +1,17 @@
|
|
|
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 { useState } from "react";
|
|
8
|
+
export default function useCombineSearchState() {
|
|
9
|
+
var _useState = useState({}),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
combineValues = _useState2[0],
|
|
12
|
+
setCombineValues = _useState2[1];
|
|
13
|
+
return {
|
|
14
|
+
combineValues: combineValues,
|
|
15
|
+
setCombineValues: setCombineValues
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ComBineSearchProps from './types';
|
|
3
|
+
declare const CombineSearch: ({ fieldNames, options, search, placeholder, prefixIcon, border, addonBefore, addonAfter, request, values, setValues, defaultSelectKey, defaultAfterChange, }: ComBineSearchProps) => React.JSX.Element;
|
|
4
|
+
export default CombineSearch;
|
|
@@ -0,0 +1,168 @@
|
|
|
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 { Select, Space } from 'antd';
|
|
8
|
+
import Icon from "../Icon";
|
|
9
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
10
|
+
import CombineContent from "./components/Content";
|
|
11
|
+
import CombineTags from "./components/Tags";
|
|
12
|
+
import { useCombineBoxStyles } from "./style";
|
|
13
|
+
import { debounce } from 'lodash';
|
|
14
|
+
var CombineSearch = function CombineSearch(_ref) {
|
|
15
|
+
var _ref$fieldNames = _ref.fieldNames,
|
|
16
|
+
fieldNames = _ref$fieldNames === void 0 ? {
|
|
17
|
+
label: 'title',
|
|
18
|
+
value: 'key'
|
|
19
|
+
} : _ref$fieldNames,
|
|
20
|
+
options = _ref.options,
|
|
21
|
+
_ref$search = _ref.search,
|
|
22
|
+
search = _ref$search === void 0 ? true : _ref$search,
|
|
23
|
+
_ref$placeholder = _ref.placeholder,
|
|
24
|
+
placeholder = _ref$placeholder === void 0 ? '请选择筛选条件' : _ref$placeholder,
|
|
25
|
+
prefixIcon = _ref.prefixIcon,
|
|
26
|
+
border = _ref.border,
|
|
27
|
+
addonBefore = _ref.addonBefore,
|
|
28
|
+
addonAfter = _ref.addonAfter,
|
|
29
|
+
request = _ref.request,
|
|
30
|
+
values = _ref.values,
|
|
31
|
+
setValues = _ref.setValues,
|
|
32
|
+
defaultSelectKey = _ref.defaultSelectKey,
|
|
33
|
+
_ref$defaultAfterChan = _ref.defaultAfterChange,
|
|
34
|
+
defaultAfterChange = _ref$defaultAfterChan === void 0 ? false : _ref$defaultAfterChan;
|
|
35
|
+
var _useState = useState(''),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
current = _useState2[0],
|
|
38
|
+
setCurrent = _useState2[1];
|
|
39
|
+
var _useState3 = useState(false),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
focus = _useState4[0],
|
|
42
|
+
setFocus = _useState4[1];
|
|
43
|
+
var _useState5 = useState([]),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
+
canSelectOptions = _useState6[0],
|
|
46
|
+
setCanSelectOptions = _useState6[1];
|
|
47
|
+
var _useCombineBoxStyles = useCombineBoxStyles({
|
|
48
|
+
focus: focus,
|
|
49
|
+
border: !!border
|
|
50
|
+
}),
|
|
51
|
+
styles = _useCombineBoxStyles.styles;
|
|
52
|
+
var _useState7 = useState(true),
|
|
53
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
54
|
+
initFlag = _useState8[0],
|
|
55
|
+
setInitFlag = _useState8[1];
|
|
56
|
+
var currentOption = useMemo(function () {
|
|
57
|
+
var findOption = canSelectOptions.find(function (i) {
|
|
58
|
+
return i[fieldNames.value] === current;
|
|
59
|
+
});
|
|
60
|
+
return findOption;
|
|
61
|
+
}, [current, canSelectOptions]);
|
|
62
|
+
useEffect(function () {
|
|
63
|
+
var resetOptions = options.filter(function (i) {
|
|
64
|
+
return !!i.componentType;
|
|
65
|
+
});
|
|
66
|
+
if (defaultSelectKey) {
|
|
67
|
+
var hasDefault = resetOptions.find(function (i) {
|
|
68
|
+
return i[fieldNames.value] === defaultSelectKey;
|
|
69
|
+
});
|
|
70
|
+
if (hasDefault) {
|
|
71
|
+
setCurrent(defaultSelectKey);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
setCanSelectOptions(resetOptions);
|
|
75
|
+
}, [options, defaultSelectKey]);
|
|
76
|
+
var getInitCallBack = useCallback(debounce(function (values) {
|
|
77
|
+
var length = !!Object.keys(values).length;
|
|
78
|
+
if (initFlag && request) {
|
|
79
|
+
setInitFlag(false);
|
|
80
|
+
request(values, current, length ? '$initValue' : '$init');
|
|
81
|
+
}
|
|
82
|
+
}, 200), [JSON.stringify(values), setValues]);
|
|
83
|
+
var getCallBack = useCallback(debounce(function (value, type) {
|
|
84
|
+
if (request && !initFlag) {
|
|
85
|
+
request(values, current, '$value');
|
|
86
|
+
}
|
|
87
|
+
}, 200), [initFlag, current, JSON.stringify(values)]);
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
getCallBack(values, '$value');
|
|
90
|
+
}, [JSON.stringify(values)]);
|
|
91
|
+
useEffect(function () {
|
|
92
|
+
getInitCallBack(values);
|
|
93
|
+
}, [JSON.stringify(values)]);
|
|
94
|
+
var onChangeCallBack = useCallback(function (cb) {
|
|
95
|
+
if (cb) {
|
|
96
|
+
cb();
|
|
97
|
+
}
|
|
98
|
+
setTimeout(function () {
|
|
99
|
+
if (defaultAfterChange) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
setCurrent('');
|
|
103
|
+
}, 100);
|
|
104
|
+
}, [defaultAfterChange]);
|
|
105
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: styles.box
|
|
107
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: styles.left
|
|
109
|
+
}, addonBefore, search ? /*#__PURE__*/React.createElement(Space.Compact, {
|
|
110
|
+
className: styles.card,
|
|
111
|
+
onBlur: function onBlur() {
|
|
112
|
+
setFocus(false);
|
|
113
|
+
},
|
|
114
|
+
onFocus: function onFocus() {
|
|
115
|
+
setFocus(true);
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: "icon-span"
|
|
119
|
+
}, prefixIcon || /*#__PURE__*/React.createElement(Icon, {
|
|
120
|
+
name: "v35_Search"
|
|
121
|
+
})), /*#__PURE__*/React.createElement(Select, {
|
|
122
|
+
placeholder: placeholder,
|
|
123
|
+
filterOption: function filterOption(input, option) {
|
|
124
|
+
var _option$fieldNames$la;
|
|
125
|
+
return ((_option$fieldNames$la = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _option$fieldNames$la !== void 0 ? _option$fieldNames$la : '').toLowerCase().includes(input.toLowerCase());
|
|
126
|
+
},
|
|
127
|
+
popupMatchSelectWidth: 150,
|
|
128
|
+
options: canSelectOptions,
|
|
129
|
+
labelRender: function labelRender(props) {
|
|
130
|
+
return /*#__PURE__*/React.createElement(Space, {
|
|
131
|
+
align: "center"
|
|
132
|
+
}, props.label + ' :');
|
|
133
|
+
},
|
|
134
|
+
className: "select-no-padding",
|
|
135
|
+
fieldNames: fieldNames,
|
|
136
|
+
value: current || null,
|
|
137
|
+
onSelect: function onSelect(value) {
|
|
138
|
+
setCurrent(value);
|
|
139
|
+
},
|
|
140
|
+
style: {
|
|
141
|
+
width: current ? '' : '100%',
|
|
142
|
+
zIndex: 100
|
|
143
|
+
},
|
|
144
|
+
suffixIcon: null,
|
|
145
|
+
showSearch: !current,
|
|
146
|
+
variant: 'borderless'
|
|
147
|
+
}), current && /*#__PURE__*/React.createElement(CombineContent, {
|
|
148
|
+
setCombineValues: setValues,
|
|
149
|
+
fieldNames: fieldNames,
|
|
150
|
+
combineValues: values,
|
|
151
|
+
onChangeState: onChangeCallBack,
|
|
152
|
+
current: currentOption
|
|
153
|
+
})) : null), /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: styles.right
|
|
155
|
+
}, addonAfter)), search ? /*#__PURE__*/React.createElement(CombineTags, {
|
|
156
|
+
setCurrent: setCurrent,
|
|
157
|
+
current: current,
|
|
158
|
+
options: canSelectOptions,
|
|
159
|
+
fieldNames: fieldNames,
|
|
160
|
+
combineValues: values,
|
|
161
|
+
setCombineValues: setValues
|
|
162
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
163
|
+
style: {
|
|
164
|
+
margin: '8px 0'
|
|
165
|
+
}
|
|
166
|
+
}));
|
|
167
|
+
};
|
|
168
|
+
export default CombineSearch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg t="1740624542262" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1619" width="200" height="200"><path d="M1008.236627 342.089199a153.00533 153.00533 0 0 0-44.688001-108.092613L790.246006 60.673537a153.180252 153.180252 0 0 0-108.443733-44.949745v0.325584c-39.070081 0-78.719828 14.667879-107.815547 44.625438-182.435571 181.536704-364.305519 364.265938-546.447426 546.0746l-0.596266 0.866947h-0.298771l-0.596266 0.569453-0.569453 0.624356v0.569452h-0.597542l-0.270682 0.596266v0.596266l-0.596265 0.569452v0.596266h-0.596266l-0.596265 0.569453-0.596266 0.89376v0.597542l-0.569453 0.297495v0.271958l-0.596265 0.596266v0.866947l-0.868224 0.596265v0.596266l-0.298772 0.597542-0.298771 0.568176h-0.270681l-0.298772 0.597543-0.325584 0.866947-0.298771 0.298771v0.596266l-0.270682 0.270682v0.624355l-0.596265 0.568176v1.464489l-0.569453 0.596266v0.569453l-0.596266 1.192531v2.331437l-0.569452 0.597542v338.403078a40.844833 40.844833 0 0 0 41.138496 41.100192H391.849926l0.866947-0.298771h3.227751l0.596265-0.270682 1.192532-0.297494 1.166995-0.298771h1.761984l1.763261-1.165719h1.161888l1.165718-0.569452 0.596266-0.596266 0.868224-0.624355 0.89376-0.568176 0.89376-0.298772 0.866947-0.569452 1.165718-0.596266 0.624356-0.569453 1.165718-0.298771 0.569453-0.596266 0.596265-0.596265 1.166996-0.596266 0.569452-0.569453 1.192532-0.596265 0.596265-1.165719 0.569453-0.868224q273.262017-273.648887 546.458917-546.101413a153.175145 153.175145 0 0 0 44.688001-108.0658z m-503.554606-95.161182l49.324061 49.315124-388.986063 389.237593-49.350875-49.071255 389.012877-389.481462zM98.041643 925.746408V735.690895l189.816752 190.055513H98.041643z m102.229547-205.309443l388.987341-388.913286 103.448891 103.401649-389.604035 388.876259-102.825813-103.374837z m188.026678 188.278208l-49.9548-49.668798 389.588713-389.480185 49.352151 49.939479-388.986064 389.209504z m537.638783-566.625974h-0.569453a69.261294 69.261294 0 0 1-20.580739 49.938202l-68.74036 68.727592-272.928772-272.006923 6.481037-7.049213 24.974208-24.942288 37.583886-37.604314a71.117761 71.117761 0 0 1 49.645815-20.576909v0.298771a69.111908 69.111908 0 0 1 49.378964 20.279414L904.786459 292.719173a68.075147 68.075147 0 0 1 21.150192 49.370026z" fill="#515151" p-id="1620"></path></svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const useCombineBoxStyles: (props?: {
|
|
2
|
+
focus: boolean;
|
|
3
|
+
border: boolean;
|
|
4
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
5
|
+
card: import("antd-style").SerializedStyles;
|
|
6
|
+
box: import("antd-style").SerializedStyles;
|
|
7
|
+
left: import("antd-style").SerializedStyles;
|
|
8
|
+
right: import("antd-style").SerializedStyles;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useTagsStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
11
|
+
label: import("antd-style").SerializedStyles;
|
|
12
|
+
value: import("antd-style").SerializedStyles;
|
|
13
|
+
currentTag: import("antd-style").SerializedStyles;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createStyles } from "antd-style";
|
|
4
|
+
import edit from "./edit.svg";
|
|
5
|
+
export var useCombineBoxStyles = createStyles(function (_ref, props) {
|
|
6
|
+
var prefixCls = _ref.prefixCls,
|
|
7
|
+
css = _ref.css,
|
|
8
|
+
token = _ref.token,
|
|
9
|
+
stylish = _ref.stylish;
|
|
10
|
+
return {
|
|
11
|
+
card: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n min-width: 300px;\n background-color: #f7f7f7;\n border: ", ";\n .icon-span {\n width: 28px;\n min-width: 28px;\n display: flex;\n justify-content: end;\n align-items: center;\n transform: translateX(5px)\n }\n .select-no-padding {\n .", "-select-selector {\n padding: 0 0 0 12px !important\n }\n }\n "])), token.borderRadius, props.focus ? "1px solid ".concat(token.colorPrimary) : "1px solid ".concat(props.border ? token.colorBorder : 'transparent'), prefixCls),
|
|
12
|
+
box: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: space-between;\n "]))),
|
|
13
|
+
left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n gap: 8px;\n align-items: center;\n flex-wrap: wrap;\n "]))),
|
|
14
|
+
right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: 2px;\n align-items: center;\n "])))
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
export var useTagsStyles = createStyles(function (_ref2) {
|
|
18
|
+
var prefixCls = _ref2.prefixCls,
|
|
19
|
+
css = _ref2.css,
|
|
20
|
+
token = _ref2.token;
|
|
21
|
+
return {
|
|
22
|
+
label: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: rgba(0, 0, 0, 0.3);\n cursor: url(", "), pointer;\n "])), edit),
|
|
23
|
+
value: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: rgba(89, 89, 89, 1);\n padding-right: 12px;\n overflow: hidden;\n cursor: url(", "), pointer;\n "])), edit),
|
|
24
|
+
currentTag: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n max-width: 350px;\n overflow: hidden;\n "])))
|
|
25
|
+
};
|
|
26
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DatePicker, GetProps, InputProps, Select } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type OmitBaseType = 'defaultOpen' | 'onBlur' | 'suffixIcon' | 'variant';
|
|
4
|
+
type SelectProps = GetProps<typeof Select>;
|
|
5
|
+
type DatePickProps = GetProps<typeof DatePicker>;
|
|
6
|
+
type RangePickerProps = GetProps<typeof DatePicker.RangePicker>;
|
|
7
|
+
type CombineInputProps = {
|
|
8
|
+
componentType?: 'Input';
|
|
9
|
+
componentProps?: Omit<InputProps, OmitBaseType>;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
type CombineSelectProps = {
|
|
13
|
+
componentType?: 'Select' | 'Checkbox' | 'StatusSelect';
|
|
14
|
+
componentProps?: Omit<SelectProps, OmitBaseType>;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
type CombineDatePick = {
|
|
18
|
+
componentType?: 'DatePick';
|
|
19
|
+
componentProps?: Omit<DatePickProps, OmitBaseType>;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
type CombineRangePick = {
|
|
23
|
+
componentType?: 'RangePick';
|
|
24
|
+
componentProps?: Omit<RangePickerProps, OmitBaseType>;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
type CombineOptionsType = CombineInputProps | CombineSelectProps | CombineDatePick | CombineRangePick;
|
|
28
|
+
export default interface ComBineSearchProps {
|
|
29
|
+
fieldNames?: {
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
};
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
border?: boolean;
|
|
35
|
+
search?: boolean;
|
|
36
|
+
prefixIcon?: React.ReactNode;
|
|
37
|
+
options: CombineOptionsType[];
|
|
38
|
+
addonBefore?: React.ReactNode;
|
|
39
|
+
addonAfter?: React.ReactNode;
|
|
40
|
+
defaultSelectKey?: string;
|
|
41
|
+
defaultAfterChange?: boolean;
|
|
42
|
+
request?: (values: Record<string, any>, changeKey: string, eventType: '$init' | '$value' | '$refresh' | '$initValue') => void;
|
|
43
|
+
values: Record<string, any>;
|
|
44
|
+
setValues: React.Dispatch<React.SetStateAction<Record<string, any>>>;
|
|
45
|
+
}
|
|
46
|
+
export { CombineOptionsType };
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ComponentUninstalledTexts } from './locale';
|
|
3
|
+
export type { ComponentUninstalledTexts } from './locale';
|
|
4
|
+
export { componentUninstalledLocaleZhCN, mergeComponentUninstalledTexts } from './locale';
|
|
5
|
+
import './index.less';
|
|
6
|
+
export interface ComponentUninstalledMenuData {
|
|
7
|
+
requiredComponents?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ComponentUninstalledStorage {
|
|
10
|
+
getSession: (key: string, returnStr?: boolean) => unknown;
|
|
11
|
+
}
|
|
12
|
+
export type GetClusterAddons = (params: {
|
|
13
|
+
clusterName: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
data?: {
|
|
16
|
+
enabled?: string[];
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
export interface ComponentUninstalledProps {
|
|
20
|
+
clusterName?: string;
|
|
21
|
+
clusterAliasName?: string;
|
|
22
|
+
/** 当前菜单;未传时从 storage 读取 currentMenu */
|
|
23
|
+
menuData?: ComponentUninstalledMenuData | null;
|
|
24
|
+
onCallback?: (hasUninstalled: boolean) => void;
|
|
25
|
+
/** 全屏遮罩页 */
|
|
26
|
+
isMask?: boolean;
|
|
27
|
+
getClusterAddons?: GetClusterAddons;
|
|
28
|
+
storage?: ComponentUninstalledStorage;
|
|
29
|
+
texts?: ComponentUninstalledTexts;
|
|
30
|
+
}
|
|
31
|
+
declare const ComponentUninstalled: React.FC<ComponentUninstalledProps>;
|
|
32
|
+
export default ComponentUninstalled;
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
import { ConfigProvider, Tag } from 'antd';
|
|
21
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
22
|
+
import Icon from "../Icon";
|
|
23
|
+
import { mergeComponentUninstalledTexts } from "./locale";
|
|
24
|
+
export { componentUninstalledLocaleZhCN, mergeComponentUninstalledTexts } from "./locale";
|
|
25
|
+
import "./index.less";
|
|
26
|
+
var defaultStorage = {
|
|
27
|
+
getSession: function getSession(key, returnStr) {
|
|
28
|
+
var value = window.sessionStorage.getItem(key) || '';
|
|
29
|
+
if (returnStr) return value;
|
|
30
|
+
try {
|
|
31
|
+
return JSON.parse(value);
|
|
32
|
+
} catch (_unused) {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var ComponentUninstalled = function ComponentUninstalled(props) {
|
|
38
|
+
var _useContext;
|
|
39
|
+
var clusterName = props.clusterName,
|
|
40
|
+
clusterAliasName = props.clusterAliasName,
|
|
41
|
+
menuData = props.menuData,
|
|
42
|
+
onCallback = props.onCallback,
|
|
43
|
+
_props$isMask = props.isMask,
|
|
44
|
+
isMask = _props$isMask === void 0 ? false : _props$isMask,
|
|
45
|
+
getClusterAddons = props.getClusterAddons,
|
|
46
|
+
_props$storage = props.storage,
|
|
47
|
+
storage = _props$storage === void 0 ? defaultStorage : _props$storage,
|
|
48
|
+
textsProp = props.texts;
|
|
49
|
+
var _useState = useState([]),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
uninstalledComponentList = _useState2[0],
|
|
52
|
+
setUninstalledComponentList = _useState2[1];
|
|
53
|
+
var _useState3 = useState([]),
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
requiredComponentList = _useState4[0],
|
|
56
|
+
setRequiredComponentList = _useState4[1];
|
|
57
|
+
var antdLocale = (_useContext = useContext(ConfigProvider.ConfigContext)) === null || _useContext === void 0 ? void 0 : _useContext.locale;
|
|
58
|
+
var t = useMemo(function () {
|
|
59
|
+
return mergeComponentUninstalledTexts(_objectSpread(_objectSpread({}, antdLocale === null || antdLocale === void 0 ? void 0 : antdLocale.compInstalled), textsProp));
|
|
60
|
+
}, [antdLocale === null || antdLocale === void 0 ? void 0 : antdLocale.compInstalled, textsProp]);
|
|
61
|
+
var applyLists = useCallback(function () {
|
|
62
|
+
var uninstalledComponents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
63
|
+
var requiredComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
64
|
+
var uninstalled = uninstalledComponents.map(function (item) {
|
|
65
|
+
return item.split('/')[0];
|
|
66
|
+
});
|
|
67
|
+
var required = requiredComponents.map(function (item) {
|
|
68
|
+
return item.split('/')[0];
|
|
69
|
+
});
|
|
70
|
+
setUninstalledComponentList(Array.from(new Set(uninstalled)));
|
|
71
|
+
setRequiredComponentList(Array.from(new Set(required)));
|
|
72
|
+
}, []);
|
|
73
|
+
var loadClusterAddons = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
74
|
+
var _currentMenu$required, _currentMenu;
|
|
75
|
+
var currentMenu, raw, required, uninstalled, _response$data$enable, _response$data, response, enabled;
|
|
76
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
77
|
+
while (1) switch (_context.prev = _context.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
currentMenu = menuData;
|
|
80
|
+
if (!currentMenu) {
|
|
81
|
+
raw = storage.getSession('currentMenu', true);
|
|
82
|
+
currentMenu = raw ? JSON.parse(String(raw)) : null;
|
|
83
|
+
}
|
|
84
|
+
required = (_currentMenu$required = (_currentMenu = currentMenu) === null || _currentMenu === void 0 ? void 0 : _currentMenu.requiredComponents) !== null && _currentMenu$required !== void 0 ? _currentMenu$required : [];
|
|
85
|
+
uninstalled = [];
|
|
86
|
+
if (!clusterName) {
|
|
87
|
+
_context.next = 16;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (getClusterAddons) {
|
|
91
|
+
_context.next = 9;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
uninstalled = _toConsumableArray(required);
|
|
95
|
+
_context.next = 14;
|
|
96
|
+
break;
|
|
97
|
+
case 9:
|
|
98
|
+
_context.next = 11;
|
|
99
|
+
return getClusterAddons({
|
|
100
|
+
clusterName: clusterName
|
|
101
|
+
});
|
|
102
|
+
case 11:
|
|
103
|
+
response = _context.sent;
|
|
104
|
+
enabled = (_response$data$enable = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.enabled) !== null && _response$data$enable !== void 0 ? _response$data$enable : [];
|
|
105
|
+
if (enabled.length === 0) {
|
|
106
|
+
uninstalled = [];
|
|
107
|
+
} else {
|
|
108
|
+
required.forEach(function (item) {
|
|
109
|
+
if (!enabled.includes(item)) {
|
|
110
|
+
uninstalled.push(item);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
case 14:
|
|
115
|
+
_context.next = 17;
|
|
116
|
+
break;
|
|
117
|
+
case 16:
|
|
118
|
+
uninstalled = _toConsumableArray(required);
|
|
119
|
+
case 17:
|
|
120
|
+
applyLists(uninstalled, required);
|
|
121
|
+
onCallback === null || onCallback === void 0 || onCallback(uninstalled.length > 0);
|
|
122
|
+
case 19:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context.stop();
|
|
125
|
+
}
|
|
126
|
+
}, _callee);
|
|
127
|
+
})), [applyLists, clusterName, getClusterAddons, menuData, onCallback, storage]);
|
|
128
|
+
useEffect(function () {
|
|
129
|
+
loadClusterAddons();
|
|
130
|
+
}, [loadClusterAddons]);
|
|
131
|
+
if (uninstalledComponentList.length === 0) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
className: "component-uninstalled-prompt-wrapper ".concat(isMask ? 'fixed-mask' : '')
|
|
136
|
+
}, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
className: "content"
|
|
138
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: "components"
|
|
140
|
+
}, /*#__PURE__*/React.createElement("h2", null, t.dependencieMissingTitle), /*#__PURE__*/React.createElement("p", null, clusterAliasName || clusterName, t.missingTips1, /*#__PURE__*/React.createElement("b", null, t.missingTips2), t.missingTips3), /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: "items"
|
|
142
|
+
}, /*#__PURE__*/React.createElement("h5", null, /*#__PURE__*/React.createElement(Icon, {
|
|
143
|
+
name: "v35_Dependent"
|
|
144
|
+
}), t.required), /*#__PURE__*/React.createElement("ul", null, requiredComponentList.map(function (item) {
|
|
145
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
146
|
+
key: item
|
|
147
|
+
}, item);
|
|
148
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: "solutions"
|
|
150
|
+
}, /*#__PURE__*/React.createElement("h4", null, t.solutionMethod), /*#__PURE__*/React.createElement("dl", null, /*#__PURE__*/React.createElement("dt", null, /*#__PURE__*/React.createElement(Icon, {
|
|
151
|
+
name: "v35_CmptInstall"
|
|
152
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
153
|
+
className: "name"
|
|
154
|
+
}, t.installNow)), /*#__PURE__*/React.createElement("dd", null, t.installNowComponents, uninstalledComponentList.map(function (item) {
|
|
155
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
156
|
+
key: item
|
|
157
|
+
}, item);
|
|
158
|
+
}))), /*#__PURE__*/React.createElement("dl", null, /*#__PURE__*/React.createElement("dt", null, /*#__PURE__*/React.createElement(Icon, {
|
|
159
|
+
name: "v35_AuthManagement"
|
|
160
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
161
|
+
className: "name"
|
|
162
|
+
}, t.authProcessing)), /*#__PURE__*/React.createElement("dd", null, t.authProcessingTips))))));
|
|
163
|
+
};
|
|
164
|
+
export default ComponentUninstalled;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
.component-uninstalled-prompt-wrapper {
|
|
2
|
+
&.fixed-mask {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 128px;
|
|
5
|
+
right: 0;
|
|
6
|
+
z-index: 98;
|
|
7
|
+
width: calc(100% - 208px);
|
|
8
|
+
height: calc(100% - 56px);
|
|
9
|
+
padding: 0 18px;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
background: #fff;
|
|
12
|
+
transition: all 0.1s;
|
|
13
|
+
&::-webkit-scrollbar,
|
|
14
|
+
&::-webkit-scrollbar:active {
|
|
15
|
+
width: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
main {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
background: url('./assets/comp-unintall-background.png') repeat-x 56px 0 #fff;
|
|
22
|
+
}
|
|
23
|
+
.content {
|
|
24
|
+
padding: 50px 24px 24px;
|
|
25
|
+
background: url('./assets/comp-unintall-bg.png') no-repeat top right;
|
|
26
|
+
}
|
|
27
|
+
.components {
|
|
28
|
+
margin-bottom: 24px;
|
|
29
|
+
color: rgba(0, 0, 0, 0.65);
|
|
30
|
+
h2 {
|
|
31
|
+
margin-bottom: 24px;
|
|
32
|
+
color: rgba(0, 0, 0, 0.85);
|
|
33
|
+
font-size: 28px;
|
|
34
|
+
}
|
|
35
|
+
.items {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: baseline;
|
|
38
|
+
h5 {
|
|
39
|
+
color: rgba(0, 0, 0, 0.65);
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
}
|
|
44
|
+
.hc-icon {
|
|
45
|
+
margin-right: 4px;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
}
|
|
48
|
+
ul {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
align-items: center;
|
|
53
|
+
padding: 8px 0;
|
|
54
|
+
li {
|
|
55
|
+
padding: 2px 8px;
|
|
56
|
+
background: rgba(0, 0, 0, 0.03);
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.solutions {
|
|
63
|
+
padding: 20px;
|
|
64
|
+
background: rgba(255, 255, 255, 0.1);
|
|
65
|
+
border: 1px solid #fff;
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
|
|
68
|
+
backdrop-filter: blur(10px);
|
|
69
|
+
h4 {
|
|
70
|
+
margin-bottom: 24px;
|
|
71
|
+
padding: 0;
|
|
72
|
+
color: rgba(0, 0, 0, 0.85);
|
|
73
|
+
font-size: 16px;
|
|
74
|
+
}
|
|
75
|
+
dl {
|
|
76
|
+
margin-bottom: 32px;
|
|
77
|
+
&:last-child {
|
|
78
|
+
margin-bottom: 0;
|
|
79
|
+
}
|
|
80
|
+
dt {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
.hc-icon {
|
|
84
|
+
margin-right: 8px;
|
|
85
|
+
font-size: 20px;
|
|
86
|
+
}
|
|
87
|
+
.name {
|
|
88
|
+
display: block;
|
|
89
|
+
height: 18px;
|
|
90
|
+
line-height: 20px;
|
|
91
|
+
border-bottom: 4px solid #b0c7f6;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
dd {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-wrap: wrap;
|
|
97
|
+
gap: 8px;
|
|
98
|
+
padding: 8px 0 0 28px;
|
|
99
|
+
.ant-tag {
|
|
100
|
+
margin: 0;
|
|
101
|
+
background: rgba(0, 0, 0, 0.05);
|
|
102
|
+
border: none;
|
|
103
|
+
border-radius: 4px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ComponentUninstalledTexts {
|
|
2
|
+
dependencieMissingTitle?: string;
|
|
3
|
+
missingTips1?: string;
|
|
4
|
+
missingTips2?: string;
|
|
5
|
+
missingTips3?: string;
|
|
6
|
+
required?: string;
|
|
7
|
+
solutionMethod?: string;
|
|
8
|
+
installNow?: string;
|
|
9
|
+
installNowComponents?: string;
|
|
10
|
+
authProcessing?: string;
|
|
11
|
+
authProcessingTips?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const componentUninstalledLocaleZhCN: Required<ComponentUninstalledTexts>;
|
|
14
|
+
export declare function mergeComponentUninstalledTexts(texts?: ComponentUninstalledTexts): Required<ComponentUninstalledTexts>;
|