@lemon-fe/kits 1.0.0-144 → 1.0.0-146
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/es/components/DataGrid/components/Search.js +5 -2
- package/es/components/DataGrid/index.js +4 -0
- package/es/components/DurationPicker/index.js +35 -33
- package/es/components/DurationPicker/index.less +0 -57
- package/es/components/Filter/index.d.ts +1 -1
- package/es/components/Filter/index.js +2 -1
- package/es/components/InputCompact/index.d.ts +10 -0
- package/es/components/InputCompact/index.js +69 -0
- package/es/components/InputCompact/index.less +18 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +1 -0
- package/es/layouts/BasicLayout/components/MainFramework/index.less +4 -0
- package/es/styles/overrides.less +5 -0
- package/package.json +1 -1
|
@@ -158,9 +158,10 @@ export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Search(props,
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
});
|
|
161
|
-
return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(
|
|
162
|
-
placeholder: placeholder,
|
|
161
|
+
return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
|
|
162
|
+
placeholder: placeholder || '输入关键字搜索',
|
|
163
163
|
value: state.keywords,
|
|
164
|
+
size: "small",
|
|
164
165
|
onChange: function onChange(e) {
|
|
165
166
|
setState(function (prev) {
|
|
166
167
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
@@ -176,8 +177,10 @@ export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Search(props,
|
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
180
|
+
size: "small",
|
|
179
181
|
onClick: handlePrev
|
|
180
182
|
}, "\u4E0A\u4E00\u4E2A"), /*#__PURE__*/React.createElement(Button, {
|
|
183
|
+
size: "small",
|
|
181
184
|
onClick: handleNext
|
|
182
185
|
}, "\u4E0B\u4E00\u4E2A"));
|
|
183
186
|
}));
|
|
@@ -1039,6 +1039,10 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
1039
1039
|
if (onLoad) {
|
|
1040
1040
|
onLoad(res.extra);
|
|
1041
1041
|
}
|
|
1042
|
+
|
|
1043
|
+
_this5.store.setState({
|
|
1044
|
+
fetchError: undefined
|
|
1045
|
+
});
|
|
1042
1046
|
}).catch(function (err) {
|
|
1043
1047
|
_this5.store.setState({
|
|
1044
1048
|
fetchError: err
|
|
@@ -24,11 +24,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
24
24
|
|
|
25
25
|
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; }
|
|
26
26
|
|
|
27
|
-
import { DatePicker,
|
|
27
|
+
import { DatePicker, Select } from 'antd';
|
|
28
28
|
import moment from 'moment';
|
|
29
29
|
import React, { useMemo, useState, useEffect } from 'react';
|
|
30
30
|
import { PREFIX_CLS } from "../../constants";
|
|
31
|
-
import
|
|
31
|
+
import InputCompact from "../InputCompact";
|
|
32
32
|
var defaultOptions = [{
|
|
33
33
|
label: '自定义时段',
|
|
34
34
|
value: null
|
|
@@ -177,37 +177,39 @@ function DurationPicker(props) {
|
|
|
177
177
|
|
|
178
178
|
return /*#__PURE__*/React.createElement("div", {
|
|
179
179
|
className: "".concat(prefixCls, "-duration")
|
|
180
|
-
}, !hideType && /*#__PURE__*/React.createElement(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}, /*#__PURE__*/React.createElement(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
})
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
180
|
+
}, !hideType && /*#__PURE__*/React.createElement(Select, {
|
|
181
|
+
options: types.map(function (item) {
|
|
182
|
+
return {
|
|
183
|
+
label: item.label,
|
|
184
|
+
value: item.label,
|
|
185
|
+
item: item
|
|
186
|
+
};
|
|
187
|
+
}),
|
|
188
|
+
style: {
|
|
189
|
+
marginRight: 8,
|
|
190
|
+
color: '#666'
|
|
191
|
+
},
|
|
192
|
+
onSelect: function onSelect(_, opt) {
|
|
193
|
+
handleChangeType(opt.item);
|
|
194
|
+
},
|
|
195
|
+
value: (_result$type = result.type) === null || _result$type === void 0 ? void 0 : _result$type.label
|
|
196
|
+
}), /*#__PURE__*/React.createElement(InputCompact, null, /*#__PURE__*/React.createElement(Select, {
|
|
197
|
+
style: {
|
|
198
|
+
width: 110,
|
|
199
|
+
color: '#666'
|
|
200
|
+
},
|
|
201
|
+
options: options.map(function (item) {
|
|
202
|
+
return {
|
|
203
|
+
label: item.label,
|
|
204
|
+
value: item.label,
|
|
205
|
+
item: item
|
|
206
|
+
};
|
|
207
|
+
}),
|
|
208
|
+
onSelect: function onSelect(_, opt) {
|
|
209
|
+
handleChangeOption(opt.item);
|
|
210
|
+
},
|
|
211
|
+
value: (_result$option = result.option) === null || _result$option === void 0 ? void 0 : _result$option.label
|
|
212
|
+
}), /*#__PURE__*/React.createElement(DatePicker.RangePicker, _extends({
|
|
211
213
|
value: result.dates,
|
|
212
214
|
onChange: handleChangeDates,
|
|
213
215
|
allowClear: false
|
|
@@ -1,61 +1,4 @@
|
|
|
1
1
|
.@{prefixCls}-duration {
|
|
2
2
|
display: flex;
|
|
3
3
|
width: 100%;
|
|
4
|
-
height: @input-height-base;
|
|
5
|
-
|
|
6
|
-
.@{ant-prefix}-dropdown-trigger {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: space-between;
|
|
10
|
-
height: 100%;
|
|
11
|
-
padding: 0 8px;
|
|
12
|
-
color: rgba(51, 51, 51, 0.7);
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
text-align: center;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
|
|
17
|
-
& > .@{ant-prefix}icon {
|
|
18
|
-
margin-left: 4px;
|
|
19
|
-
font-size: 14px;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&-type.@{ant-prefix}-dropdown-trigger {
|
|
24
|
-
flex: 0 0 auto;
|
|
25
|
-
margin-right: 8px;
|
|
26
|
-
border: 1px solid @select-border-color;
|
|
27
|
-
border-radius: @border-radius-base;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&-option.@{ant-prefix}-dropdown-trigger {
|
|
31
|
-
position: relative;
|
|
32
|
-
flex: 0 0 110px;
|
|
33
|
-
|
|
34
|
-
&::after {
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 50%;
|
|
37
|
-
right: 0;
|
|
38
|
-
display: block;
|
|
39
|
-
width: 1px;
|
|
40
|
-
height: 14px;
|
|
41
|
-
margin-top: -7px;
|
|
42
|
-
background-color: #d8d8d8;
|
|
43
|
-
content: '';
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&-picker {
|
|
48
|
-
display: flex;
|
|
49
|
-
flex: 1;
|
|
50
|
-
height: 100%;
|
|
51
|
-
border: 1px solid @select-border-color;
|
|
52
|
-
border-radius: @border-radius-base;
|
|
53
|
-
|
|
54
|
-
.@{ant-prefix}-picker {
|
|
55
|
-
flex: 1;
|
|
56
|
-
border: none;
|
|
57
|
-
outline: none;
|
|
58
|
-
box-shadow: none;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
4
|
}
|
|
@@ -7,7 +7,7 @@ declare namespace Filter {
|
|
|
7
7
|
title: string;
|
|
8
8
|
value: Record<string | number, any>;
|
|
9
9
|
}>(getData: (storageKey: string) => T[] | Promise<T[]>, setData: (storageKey: string, data: T[], action: {
|
|
10
|
-
type: "
|
|
10
|
+
type: "delete" | "set";
|
|
11
11
|
target: T;
|
|
12
12
|
}) => void | Promise<void>) => void;
|
|
13
13
|
var defaultProps: Partial<FilterProps<Record<string, any>>>;
|
|
@@ -35,7 +35,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
35
35
|
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); }
|
|
36
36
|
|
|
37
37
|
import { useDebounce, useRequest } from '@lemon-fe/hooks';
|
|
38
|
-
import { Button, Checkbox, Form, Input, Popover, Space, Modal, message, Select, Empty
|
|
38
|
+
import { Button, Checkbox, Form, Input, Popover, Space, Modal, message, Select, Empty } from 'antd';
|
|
39
39
|
import classNames from 'classnames';
|
|
40
40
|
import ResizeObserver from 'rc-resize-observer';
|
|
41
41
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
@@ -43,6 +43,7 @@ import Dropdown from "../Dropdown";
|
|
|
43
43
|
import DurationPicker from "../DurationPicker";
|
|
44
44
|
import FormLayout from "../FormLayout";
|
|
45
45
|
import Icons from "../Icons";
|
|
46
|
+
import InputNumber from "../InputNumber";
|
|
46
47
|
import TabBar from "../TabBar";
|
|
47
48
|
import { prefixClassName } from "../utils";
|
|
48
49
|
var components = [{
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* 会同时禁用多个表单
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function InputCompact(props: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var _excluded = ["children", "className", "disabled", "onFocus", "onBlur"];
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
9
|
+
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."); }
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
+
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
import { ConfigProvider } from 'antd';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import React, { useContext, useState, Children, cloneElement, isValidElement } from 'react';
|
|
26
|
+
import { prefixClassName } from "../utils";
|
|
27
|
+
var prefix = prefixClassName('input-compact');
|
|
28
|
+
export default function InputCompact(props) {
|
|
29
|
+
var _classNames;
|
|
30
|
+
|
|
31
|
+
var children = props.children,
|
|
32
|
+
className = props.className,
|
|
33
|
+
disabled = props.disabled,
|
|
34
|
+
_onFocus = props.onFocus,
|
|
35
|
+
_onBlur = props.onBlur,
|
|
36
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
37
|
+
|
|
38
|
+
var inputPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls('input');
|
|
39
|
+
|
|
40
|
+
var _useState = useState(false),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
focused = _useState2[0],
|
|
43
|
+
setFocused = _useState2[1];
|
|
44
|
+
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
46
|
+
className: classNames(className, prefix(), inputPrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(inputPrefixCls, "-focused"), focused), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames)),
|
|
47
|
+
onFocus: function onFocus(e) {
|
|
48
|
+
setFocused(true);
|
|
49
|
+
_onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
|
|
50
|
+
},
|
|
51
|
+
onBlur: function onBlur(e) {
|
|
52
|
+
setFocused(false);
|
|
53
|
+
_onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e);
|
|
54
|
+
}
|
|
55
|
+
}, restProps), Children.map(children, function (node) {
|
|
56
|
+
var newNode = node;
|
|
57
|
+
|
|
58
|
+
if ( /*#__PURE__*/isValidElement(node)) {
|
|
59
|
+
newNode = /*#__PURE__*/cloneElement(node, {
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
bordered: false
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, newNode, /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: prefix('gutter')
|
|
67
|
+
}));
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.@{prefixCls}-input-compact {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: @input-height-base;
|
|
5
|
+
padding: 0;
|
|
6
|
+
|
|
7
|
+
&-gutter {
|
|
8
|
+
position: relative;
|
|
9
|
+
display: block;
|
|
10
|
+
width: 1px;
|
|
11
|
+
height: (@input-height-base - 2px - 10px);
|
|
12
|
+
background-color: @border-color-base;
|
|
13
|
+
|
|
14
|
+
&:last-child {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export { default as State } from './components/State';
|
|
|
43
43
|
export { default as GreyPanel } from './components/GreyPanel';
|
|
44
44
|
export { default as Alert } from './components/Alert';
|
|
45
45
|
export { default as InputNumber } from './components/InputNumber';
|
|
46
|
+
export { default as InputCompact } from './components/InputCompact';
|
|
46
47
|
export { default as BasicLayout } from './layouts/BasicLayout';
|
|
47
48
|
export { default as BlankLayout } from './layouts/BlankLayout';
|
|
48
49
|
export { default as MicroLayout } from './layouts/MicroLayout';
|
package/es/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export { default as State } from "./components/State";
|
|
|
35
35
|
export { default as GreyPanel } from "./components/GreyPanel";
|
|
36
36
|
export { default as Alert } from "./components/Alert";
|
|
37
37
|
export { default as InputNumber } from "./components/InputNumber";
|
|
38
|
+
export { default as InputCompact } from "./components/InputCompact";
|
|
38
39
|
export { default as BasicLayout } from "./layouts/BasicLayout";
|
|
39
40
|
export { default as BlankLayout } from "./layouts/BlankLayout";
|
|
40
41
|
export { default as MicroLayout } from "./layouts/MicroLayout";
|
package/es/index.less
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
@import './components/State/index.less';
|
|
25
25
|
@import './components/GreyPanel/index.less';
|
|
26
26
|
@import './components/InputNumber/index.less';
|
|
27
|
+
@import './components//InputCompact/index.less';
|
|
27
28
|
|
|
28
29
|
@import './layouts/BasicLayout/components/MainFramework/index.less';
|
|
29
30
|
@import './layouts/Breadcrumb/index.less';
|
package/es/styles/overrides.less
CHANGED
|
@@ -171,6 +171,11 @@ a[title='站长统计'] {
|
|
|
171
171
|
@input-disabled-color: fade(#333, 70);
|
|
172
172
|
@input-disabled-bg: #fff;
|
|
173
173
|
|
|
174
|
+
.@{ant-prefix}-input-prefix,
|
|
175
|
+
.@{ant-prefix}-input-suffix {
|
|
176
|
+
color: #666;
|
|
177
|
+
}
|
|
178
|
+
|
|
174
179
|
/** picker */
|
|
175
180
|
.@{ant-prefix}-picker {
|
|
176
181
|
.@{ant-prefix}-picker-clear {
|