@lemon-fe/kits 1.0.0-168 → 1.0.0-169

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.
@@ -14,7 +14,7 @@ declare type Option = {
14
14
  label: string;
15
15
  value: () => Moment[];
16
16
  };
17
- interface Props extends Omit<RangePickerProps, 'value' | 'onChange'> {
17
+ interface Props extends Omit<RangePickerProps, 'value' | 'onChange' | 'disabled'> {
18
18
  prefixCls?: string;
19
19
  types: DateType[];
20
20
  options?: Option[];
@@ -22,6 +22,7 @@ interface Props extends Omit<RangePickerProps, 'value' | 'onChange'> {
22
22
  value?: DurationPickerValue;
23
23
  hideType?: boolean;
24
24
  onChange?: (value: DurationPickerValue) => void;
25
+ disabled?: boolean;
25
26
  }
26
27
  declare function DurationPicker(props: Props): JSX.Element;
27
28
  export default DurationPicker;
@@ -1,4 +1,4 @@
1
- var _excluded = ["prefixCls", "types", "hideType", "options", "value", "dateFormat", "onChange", "style"];
1
+ var _excluded = ["prefixCls", "types", "hideType", "options", "value", "dateFormat", "onChange", "style", "disabled"];
2
2
 
3
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
4
 
@@ -87,6 +87,7 @@ function DurationPicker(props) {
87
87
  dateFormat = _props$dateFormat === void 0 ? 'YYYY-MM-DD' : _props$dateFormat,
88
88
  onChange = props.onChange,
89
89
  style = props.style,
90
+ disabled = props.disabled,
90
91
  restProps = _objectWithoutProperties(props, _excluded);
91
92
 
92
93
  var defaultDurationPickerValue = useMemo(function () {
@@ -191,6 +192,7 @@ function DurationPicker(props) {
191
192
  item: item
192
193
  };
193
194
  }),
195
+ disabled: disabled,
194
196
  style: {
195
197
  marginRight: 8,
196
198
  color: '#666'
@@ -199,7 +201,9 @@ function DurationPicker(props) {
199
201
  handleChangeType(opt.item);
200
202
  },
201
203
  value: (_result$type = result.type) === null || _result$type === void 0 ? void 0 : _result$type.label
202
- }), /*#__PURE__*/React.createElement(InputCompact, null, /*#__PURE__*/React.createElement(Select, {
204
+ }), /*#__PURE__*/React.createElement(InputCompact, {
205
+ disabled: disabled
206
+ }, /*#__PURE__*/React.createElement(Select, {
203
207
  style: {
204
208
  width: 110,
205
209
  color: '#666'
@@ -42,6 +42,16 @@ export default function InputCompact(props) {
42
42
  focused = _useState2[0],
43
43
  setFocused = _useState2[1];
44
44
 
45
+ var extraProps = {
46
+ bordered: false
47
+ };
48
+
49
+ if (disabled !== undefined) {
50
+ Object.assign(extraProps, {
51
+ disabled: disabled
52
+ });
53
+ }
54
+
45
55
  return /*#__PURE__*/React.createElement("div", _extends({
46
56
  className: classNames(className, prefix(), inputPrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(inputPrefixCls, "-focused"), focused), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames)),
47
57
  onFocus: function onFocus(e) {
@@ -56,10 +66,7 @@ export default function InputCompact(props) {
56
66
  var newNode = node;
57
67
 
58
68
  if ( /*#__PURE__*/isValidElement(node)) {
59
- newNode = /*#__PURE__*/cloneElement(node, {
60
- disabled: disabled,
61
- bordered: false
62
- });
69
+ newNode = /*#__PURE__*/cloneElement(node, extraProps);
63
70
  }
64
71
 
65
72
  return /*#__PURE__*/React.createElement(React.Fragment, null, newNode, /*#__PURE__*/React.createElement("div", {
@@ -272,11 +272,7 @@ function Popup(props) {
272
272
  suffix: /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && !readOnly && allowClear && label && /*#__PURE__*/React.createElement(Icons.Clear, {
273
273
  className: "".concat(getPrefixCls('input'), "-clear-icon ").concat(prefix('input-clear')),
274
274
  onClick: handleClear
275
- }), /*#__PURE__*/React.createElement(SearchIcon, {
276
- style: {
277
- color: 'rgba(51,51,51,0.7)'
278
- }
279
- }))
275
+ }), /*#__PURE__*/React.createElement(SearchIcon, null))
280
276
  });
281
277
  }
282
278
 
@@ -216,7 +216,8 @@ export default function SelectView(props) {
216
216
  rowSelection: {
217
217
  type: multiple ? 'checkbox' : 'radio',
218
218
  selectedRowKeys: dataKeys,
219
- onChange: handleChangeData
219
+ onChange: handleChangeData,
220
+ preserveSelectedRowKeys: true
220
221
  },
221
222
  onRowDoubleClicked: function onRowDoubleClicked(_ref2) {
222
223
  var node = _ref2.node;
@@ -173,7 +173,7 @@ a[title='站长统计'] {
173
173
 
174
174
  .@{ant-prefix}-input-prefix,
175
175
  .@{ant-prefix}-input-suffix {
176
- color: #666;
176
+ color: rgba(51, 51, 51, 0.7);
177
177
  }
178
178
 
179
179
  /** picker */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-168",
3
+ "version": "1.0.0-169",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",