@lemon-fe/components 0.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/README.md +11 -0
- package/es/Actions/index.d.ts +25 -0
- package/es/Actions/index.js +164 -0
- package/es/Actions/index.less +82 -0
- package/es/BaseTable/BaseTableContext.d.ts +6 -0
- package/es/BaseTable/BaseTableContext.js +6 -0
- package/es/BaseTable/ResizeHeaderCell.d.ts +8 -0
- package/es/BaseTable/ResizeHeaderCell.js +115 -0
- package/es/BaseTable/Sort.d.ts +10 -0
- package/es/BaseTable/Sort.js +122 -0
- package/es/BaseTable/VirtualBody.d.ts +8 -0
- package/es/BaseTable/VirtualBody.js +165 -0
- package/es/BaseTable/index.d.ts +7 -0
- package/es/BaseTable/index.js +371 -0
- package/es/BaseTable/index.less +103 -0
- package/es/BaseTable/typings.d.ts +32 -0
- package/es/BaseTable/utils.d.ts +4 -0
- package/es/BaseTable/utils.js +26 -0
- package/es/DurationPicker/index.d.ts +26 -0
- package/es/DurationPicker/index.js +234 -0
- package/es/DurationPicker/index.less +63 -0
- package/es/EditableTable/EditableCell.d.ts +11 -0
- package/es/EditableTable/EditableCell.js +37 -0
- package/es/EditableTable/EditableTableFormItem.d.ts +6 -0
- package/es/EditableTable/EditableTableFormItem.js +49 -0
- package/es/EditableTable/Table.d.ts +7 -0
- package/es/EditableTable/Table.js +363 -0
- package/es/EditableTable/index.d.ts +9 -0
- package/es/EditableTable/index.js +8 -0
- package/es/EditableTable/index.less +19 -0
- package/es/EditableTable/typings.d.ts +86 -0
- package/es/EditableTable/util.d.ts +25 -0
- package/es/EditableTable/util.js +387 -0
- package/es/Filter/index.d.ts +7 -0
- package/es/Filter/index.js +469 -0
- package/es/Filter/index.less +77 -0
- package/es/Filter/typings.d.ts +27 -0
- package/es/FormLayout/index.d.ts +32 -0
- package/es/FormLayout/index.js +41 -0
- package/es/FormLayout/index.less +89 -0
- package/es/Icons/DarkSearch.d.ts +5 -0
- package/es/Icons/DarkSearch.js +38 -0
- package/es/Icons/Down.d.ts +5 -0
- package/es/Icons/Down.js +30 -0
- package/es/Icons/Empty.d.ts +2 -0
- package/es/Icons/Empty.js +267 -0
- package/es/Icons/Search.d.ts +5 -0
- package/es/Icons/Search.js +39 -0
- package/es/Icons/Tip.d.ts +6 -0
- package/es/Icons/Tip.js +169 -0
- package/es/Icons/index.d.ts +12 -0
- package/es/Icons/index.js +13 -0
- package/es/InputMaxLength/index.d.ts +14 -0
- package/es/InputMaxLength/index.js +92 -0
- package/es/InputMaxLength/index.less +8 -0
- package/es/Layout/index.d.ts +21 -0
- package/es/Layout/index.js +35 -0
- package/es/Layout/index.less +92 -0
- package/es/PageLoading/index.d.ts +5 -0
- package/es/PageLoading/index.js +15 -0
- package/es/PageLoading/index.less +10 -0
- package/es/Popup/index.d.ts +27 -0
- package/es/Popup/index.js +191 -0
- package/es/Popup/index.less +14 -0
- package/es/Section/index.d.ts +54 -0
- package/es/Section/index.js +111 -0
- package/es/Section/index.less +177 -0
- package/es/SiderTree/TreeNodeTitle.d.ts +9 -0
- package/es/SiderTree/TreeNodeTitle.js +124 -0
- package/es/SiderTree/index.d.ts +35 -0
- package/es/SiderTree/index.js +237 -0
- package/es/SiderTree/index.less +170 -0
- package/es/SiderTree/typings.d.ts +19 -0
- package/es/Table/index.d.ts +3 -0
- package/es/Table/index.js +224 -0
- package/es/Table/index.less +1 -0
- package/es/Table/typings.d.ts +26 -0
- package/es/Table/utils.d.ts +2 -0
- package/es/Table/utils.js +3 -0
- package/es/TipMark/index.d.ts +10 -0
- package/es/TipMark/index.js +45 -0
- package/es/TipMark/index.less +8 -0
- package/es/constants.d.ts +1 -0
- package/es/constants.js +1 -0
- package/es/index.d.ts +21 -0
- package/es/index.js +17 -0
- package/es/index.less +50 -0
- package/es/init.d.ts +3 -0
- package/es/init.js +100 -0
- package/es/theme.less +13 -0
- package/package.json +43 -0
package/es/Icons/Tip.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
var _excluded = ["type"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import Icon from '@ant-design/icons';
|
|
15
|
+
|
|
16
|
+
var ErrorSvg = function ErrorSvg(props) {
|
|
17
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread({
|
|
18
|
+
width: "1em",
|
|
19
|
+
height: "1em",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
+
viewBox: "0 0 20 20"
|
|
22
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
23
|
+
fill: "none",
|
|
24
|
+
fillRule: "evenodd"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
26
|
+
fill: "#EC4510",
|
|
27
|
+
cx: "10",
|
|
28
|
+
cy: "10",
|
|
29
|
+
r: "10"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
31
|
+
transform: "rotate(45 3.172 12.828)",
|
|
32
|
+
fill: "#FFF"
|
|
33
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
34
|
+
x: "4",
|
|
35
|
+
width: "4",
|
|
36
|
+
height: "12",
|
|
37
|
+
rx: "1"
|
|
38
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
39
|
+
transform: "rotate(90 6 6)",
|
|
40
|
+
x: "4",
|
|
41
|
+
width: "4",
|
|
42
|
+
height: "12",
|
|
43
|
+
rx: "1"
|
|
44
|
+
}))));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var SuccessSvg = function SuccessSvg(props) {
|
|
48
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread({
|
|
49
|
+
width: "1em",
|
|
50
|
+
height: "1em",
|
|
51
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
52
|
+
viewBox: "0 0 20 20"
|
|
53
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
54
|
+
fill: "none",
|
|
55
|
+
fillRule: "evenodd"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
57
|
+
fill: "#1ED07C",
|
|
58
|
+
cx: "10",
|
|
59
|
+
cy: "10",
|
|
60
|
+
r: "10"
|
|
61
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
62
|
+
transform: "rotate(45 3.379 14.743)",
|
|
63
|
+
fill: "#FFF"
|
|
64
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
65
|
+
x: "4",
|
|
66
|
+
width: "4",
|
|
67
|
+
height: "12",
|
|
68
|
+
rx: "1"
|
|
69
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
70
|
+
transform: "rotate(90 4 10)",
|
|
71
|
+
x: "2",
|
|
72
|
+
y: "6",
|
|
73
|
+
width: "4",
|
|
74
|
+
height: "8",
|
|
75
|
+
rx: "1"
|
|
76
|
+
}))));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var WarningSvg = function WarningSvg(props) {
|
|
80
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread({
|
|
81
|
+
width: "1em",
|
|
82
|
+
height: "1em",
|
|
83
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
84
|
+
viewBox: "0 0 20 20"
|
|
85
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
86
|
+
fill: "none",
|
|
87
|
+
fillRule: "evenodd"
|
|
88
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
89
|
+
fill: "#FAAD14",
|
|
90
|
+
cx: "10",
|
|
91
|
+
cy: "10",
|
|
92
|
+
r: "10"
|
|
93
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
94
|
+
fill: "#FFF",
|
|
95
|
+
x: "8",
|
|
96
|
+
y: "13",
|
|
97
|
+
width: "4",
|
|
98
|
+
height: "4",
|
|
99
|
+
rx: "1"
|
|
100
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
101
|
+
fill: "#FFF",
|
|
102
|
+
x: "8",
|
|
103
|
+
y: "4",
|
|
104
|
+
width: "4",
|
|
105
|
+
height: "8",
|
|
106
|
+
rx: "1"
|
|
107
|
+
})));
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
var InfoSvg = function InfoSvg(props) {
|
|
111
|
+
return /*#__PURE__*/React.createElement("svg", _objectSpread({
|
|
112
|
+
width: "1em",
|
|
113
|
+
height: "1em",
|
|
114
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
115
|
+
viewBox: "0 0 20 20"
|
|
116
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
117
|
+
fill: "none",
|
|
118
|
+
fillRule: "evenodd"
|
|
119
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
120
|
+
fill: "#2357DF",
|
|
121
|
+
cx: "10",
|
|
122
|
+
cy: "10",
|
|
123
|
+
r: "10"
|
|
124
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
125
|
+
fill: "#FFF",
|
|
126
|
+
x: "8",
|
|
127
|
+
y: "4",
|
|
128
|
+
width: "4",
|
|
129
|
+
height: "4",
|
|
130
|
+
rx: "1"
|
|
131
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
132
|
+
fill: "#FFF",
|
|
133
|
+
x: "8",
|
|
134
|
+
y: "9",
|
|
135
|
+
width: "4",
|
|
136
|
+
height: "8",
|
|
137
|
+
rx: "1"
|
|
138
|
+
})));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default function Tip(props) {
|
|
142
|
+
var _props$type = props.type,
|
|
143
|
+
type = _props$type === void 0 ? 'success' : _props$type,
|
|
144
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
145
|
+
|
|
146
|
+
var comp;
|
|
147
|
+
|
|
148
|
+
switch (type) {
|
|
149
|
+
case 'warning':
|
|
150
|
+
comp = WarningSvg;
|
|
151
|
+
break;
|
|
152
|
+
|
|
153
|
+
case 'error':
|
|
154
|
+
comp = ErrorSvg;
|
|
155
|
+
break;
|
|
156
|
+
|
|
157
|
+
case 'info':
|
|
158
|
+
comp = InfoSvg;
|
|
159
|
+
break;
|
|
160
|
+
|
|
161
|
+
case 'success':
|
|
162
|
+
default:
|
|
163
|
+
comp = SuccessSvg;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread({
|
|
167
|
+
component: comp
|
|
168
|
+
}, restProps));
|
|
169
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Down from './Down';
|
|
2
|
+
import Search from './Search';
|
|
3
|
+
import Tip from './Tip';
|
|
4
|
+
import DarkSearch from './DarkSearch';
|
|
5
|
+
declare const Icons: {
|
|
6
|
+
Search: typeof Search;
|
|
7
|
+
Down: typeof Down;
|
|
8
|
+
Tip: typeof Tip;
|
|
9
|
+
Empty: () => JSX.Element;
|
|
10
|
+
DarkSearch: typeof DarkSearch;
|
|
11
|
+
};
|
|
12
|
+
export default Icons;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Down from './Down';
|
|
2
|
+
import Search from './Search';
|
|
3
|
+
import Tip from './Tip';
|
|
4
|
+
import Empty from './Empty';
|
|
5
|
+
import DarkSearch from './DarkSearch';
|
|
6
|
+
var Icons = {
|
|
7
|
+
Search: Search,
|
|
8
|
+
Down: Down,
|
|
9
|
+
Tip: Tip,
|
|
10
|
+
Empty: Empty,
|
|
11
|
+
DarkSearch: DarkSearch
|
|
12
|
+
};
|
|
13
|
+
export default Icons;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
declare type Value = string | number | undefined;
|
|
3
|
+
interface InputWithLengthLimitProps {
|
|
4
|
+
maxLength?: number;
|
|
5
|
+
value?: Value;
|
|
6
|
+
isRealLength?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
defaultValue?: Value;
|
|
12
|
+
}
|
|
13
|
+
declare const InputWithLengthLimit: (props: InputWithLengthLimitProps) => JSX.Element;
|
|
14
|
+
export default InputWithLengthLimit;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var _excluded = ["maxLength", "value", "isRealLength", "className", "onChange"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import { Input } from 'antd';
|
|
16
|
+
|
|
17
|
+
var InputWithLengthLimit = function InputWithLengthLimit(props) {
|
|
18
|
+
var _props$maxLength = props.maxLength,
|
|
19
|
+
maxLength = _props$maxLength === void 0 ? 10 : _props$maxLength,
|
|
20
|
+
value = props.value,
|
|
21
|
+
isRealLength = props.isRealLength,
|
|
22
|
+
_props$className = props.className,
|
|
23
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
24
|
+
onChange = props.onChange,
|
|
25
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
|
|
27
|
+
var getTextLength = function getTextLength(str) {
|
|
28
|
+
var chiLength = 0; //中文汉字数
|
|
29
|
+
|
|
30
|
+
var maxLength = 10;
|
|
31
|
+
var len = 0;
|
|
32
|
+
chiLength = 0; //中文汉字数
|
|
33
|
+
|
|
34
|
+
for (var i = 0; i < str.length; i++) {
|
|
35
|
+
var c = str.charCodeAt(i);
|
|
36
|
+
var one = c >= 0x0001 && c <= 0x007e || 0xff60 <= c && c <= 0xff9f; //单字节加1
|
|
37
|
+
|
|
38
|
+
if (one && len <= 20) {
|
|
39
|
+
len++;
|
|
40
|
+
maxLength++;
|
|
41
|
+
} else if (len < 20) {
|
|
42
|
+
len += 2;
|
|
43
|
+
chiLength++;
|
|
44
|
+
maxLength++;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return len;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var handleOnChange = function handleOnChange(event) {
|
|
52
|
+
var value = event.target.value;
|
|
53
|
+
var newValue = value ? value.toString() : '';
|
|
54
|
+
|
|
55
|
+
if (isRealLength) {
|
|
56
|
+
var currentNum = getTextLength(newValue);
|
|
57
|
+
|
|
58
|
+
if (currentNum > maxLength) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (onChange) onChange(value);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var renderLengthNotice = function renderLengthNotice() {
|
|
67
|
+
var newValue = value ? value.toString() : '';
|
|
68
|
+
var currentNum = 0;
|
|
69
|
+
currentNum = newValue && newValue.length || 0;
|
|
70
|
+
|
|
71
|
+
if (isRealLength) {
|
|
72
|
+
currentNum = getTextLength(newValue);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
76
|
+
style: {
|
|
77
|
+
color: '#aaa'
|
|
78
|
+
}
|
|
79
|
+
}, currentNum, "/", maxLength);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return /*#__PURE__*/React.createElement(Input, _objectSpread(_objectSpread({
|
|
83
|
+
className: classNames('input-max-length', className),
|
|
84
|
+
maxLength: maxLength,
|
|
85
|
+
value: value
|
|
86
|
+
}, otherProps), {}, {
|
|
87
|
+
onChange: handleOnChange,
|
|
88
|
+
suffix: renderLengthNotice()
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export default InputWithLengthLimit;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
/**
|
|
7
|
+
* @description 加载中
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @description 高度是否为100%
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
full?: boolean;
|
|
16
|
+
left?: ReactNode;
|
|
17
|
+
header?: ReactNode;
|
|
18
|
+
footer?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export default function Layout(props: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
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 from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { Spin } from 'antd';
|
|
6
|
+
import { PREFIX_CLS } from '../constants';
|
|
7
|
+
export default function Layout(props) {
|
|
8
|
+
var className = props.className,
|
|
9
|
+
style = props.style,
|
|
10
|
+
children = props.children,
|
|
11
|
+
_props$loading = props.loading,
|
|
12
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
13
|
+
_props$full = props.full,
|
|
14
|
+
full = _props$full === void 0 ? false : _props$full,
|
|
15
|
+
header = props.header,
|
|
16
|
+
left = props.left,
|
|
17
|
+
footer = props.footer;
|
|
18
|
+
var prefixCls = "".concat(PREFIX_CLS, "-layout");
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: classNames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-full"), full)),
|
|
21
|
+
style: style
|
|
22
|
+
}, header ? /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "".concat(prefixCls, "-header")
|
|
24
|
+
}, header) : null, /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "".concat(prefixCls, "-content")
|
|
26
|
+
}, left ? /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "".concat(prefixCls, "-left")
|
|
28
|
+
}, left) : null, /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "".concat(prefixCls, "-main")
|
|
30
|
+
}, children)), footer ? /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "".concat(prefixCls, "-footer")
|
|
32
|
+
}, footer) : null, loading && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(prefixCls, "-spin")
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Spin, null)));
|
|
35
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@import '../theme.less';
|
|
2
|
+
|
|
3
|
+
.@{prefixCls}-layout {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
min-height: 100%;
|
|
8
|
+
background: #f5f5f5;
|
|
9
|
+
|
|
10
|
+
&-header {
|
|
11
|
+
padding: (@space - 3) @space 0;
|
|
12
|
+
|
|
13
|
+
.@{prefixCls}-actions {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
height: 22px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-content {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex: 1;
|
|
23
|
+
padding: @space;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-header + &-content {
|
|
27
|
+
padding-top: @space - 3;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-left {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 0 0 242px;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
margin-right: @space;
|
|
36
|
+
overflow: auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-main {
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
|
|
43
|
+
& > .@{prefixCls}-section:not(:first-child) {
|
|
44
|
+
margin-top: @space;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
& > .@{prefixCls}-section-with-actions:not(:first-child) {
|
|
48
|
+
margin-top: @space / 2;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&-footer {
|
|
53
|
+
position: sticky;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
z-index: 10;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 65px;
|
|
62
|
+
padding: @space;
|
|
63
|
+
background: #fff;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&-spin {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
left: 0;
|
|
72
|
+
z-index: 3;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.@{prefixCls}-layout.@{prefixCls}-layout-full {
|
|
81
|
+
height: 100%;
|
|
82
|
+
min-height: 0;
|
|
83
|
+
|
|
84
|
+
.@{prefixCls}-layout-content {
|
|
85
|
+
min-height: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.@{prefixCls}-layout-main {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Spin } from 'antd';
|
|
3
|
+
import { PREFIX_CLS } from '../constants';
|
|
4
|
+
|
|
5
|
+
var PageLoading = function PageLoading(_ref) {
|
|
6
|
+
var tip = _ref.tip;
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "".concat(PREFIX_CLS, "-page-loading")
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
10
|
+
size: "large",
|
|
11
|
+
tip: tip
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default PageLoading;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentType, ReactElement } from 'react';
|
|
2
|
+
import { ModalProps } from 'antd/lib/modal';
|
|
3
|
+
export interface PopupProps<ValueType> extends ModalProps {
|
|
4
|
+
value?: ValueType;
|
|
5
|
+
onChange?: (value?: ValueType) => void;
|
|
6
|
+
component: ComponentType<{
|
|
7
|
+
value?: ValueType;
|
|
8
|
+
onChange: (value: ValueType) => void;
|
|
9
|
+
}>;
|
|
10
|
+
formatLabel?: (value: ValueType) => string;
|
|
11
|
+
beforeOk?: (value: ValueType) => ValueType | PromiseLike<ValueType>;
|
|
12
|
+
children?: ReactElement;
|
|
13
|
+
allowClear?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
showLabel?: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
disabledTip?: string;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
interface ValuedPopupProps<ValueType> extends Omit<PopupProps<ValueType>, 'value' | 'onChange'> {
|
|
22
|
+
value: ValueType;
|
|
23
|
+
onChange?: (value: ValueType) => void;
|
|
24
|
+
}
|
|
25
|
+
declare function Popup<ValueType>(props: ValuedPopupProps<ValueType>): JSX.Element;
|
|
26
|
+
declare function Popup<ValueType>(props: PopupProps<ValueType>): JSX.Element;
|
|
27
|
+
export default Popup;
|