@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.
@@ -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("span", null, "\u5173\u952E\u5B57"), /*#__PURE__*/React.createElement(Input, {
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, Dropdown, Menu } from 'antd';
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 Down from "../Icons/Down";
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(Dropdown, {
181
- overlay: /*#__PURE__*/React.createElement(Menu, {
182
- items: types.map(function (item) {
183
- return {
184
- label: item.label,
185
- key: item.value,
186
- onClick: function onClick() {
187
- handleChangeType(item);
188
- }
189
- };
190
- })
191
- })
192
- }, /*#__PURE__*/React.createElement("div", {
193
- className: "".concat(prefixCls, "-duration-type")
194
- }, (_result$type = result.type) === null || _result$type === void 0 ? void 0 : _result$type.label, /*#__PURE__*/React.createElement(Down, null))), /*#__PURE__*/React.createElement("div", {
195
- className: "".concat(prefixCls, "-duration-picker")
196
- }, /*#__PURE__*/React.createElement(Dropdown, {
197
- overlay: /*#__PURE__*/React.createElement(Menu, {
198
- items: options.map(function (item) {
199
- return {
200
- label: item.label,
201
- key: item.label,
202
- onClick: function onClick() {
203
- handleChangeOption(item);
204
- }
205
- };
206
- })
207
- })
208
- }, /*#__PURE__*/React.createElement("div", {
209
- className: "".concat(prefixCls, "-duration-option")
210
- }, (_result$option = result.option) === null || _result$option === void 0 ? void 0 : _result$option.label, /*#__PURE__*/React.createElement(Down, null))), /*#__PURE__*/React.createElement(DatePicker.RangePicker, _extends({
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: "set" | "delete";
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, InputNumber } from 'antd';
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';
@@ -87,6 +87,10 @@
87
87
  background-color: #fff;
88
88
  border-top-left-radius: 8px;
89
89
  border-top-right-radius: 8px;
90
+
91
+ &:first-child {
92
+ margin-top: 8px;
93
+ }
90
94
  }
91
95
  }
92
96
  }
@@ -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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-144",
3
+ "version": "1.0.0-146",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",