@lemon-fe/kits 1.0.0-174 → 1.0.0-176

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.
@@ -5,6 +5,7 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
5
5
  * 会同时禁用多个表单
6
6
  */
7
7
  disabled?: boolean;
8
+ split?: string;
8
9
  }
9
10
  export default function InputCompact(props: Props): JSX.Element;
10
11
  export {};
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "className", "disabled", "onFocus", "onBlur"];
1
+ var _excluded = ["children", "className", "disabled", "onFocus", "onBlur", "split"];
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
 
@@ -20,7 +20,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
20
20
 
21
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
22
 
23
- import { ConfigProvider } from 'antd';
23
+ import { ConfigProvider, Form } from 'antd';
24
24
  import classNames from 'classnames';
25
25
  import React, { useContext, useState, Children, cloneElement, isValidElement } from 'react';
26
26
  import { prefixClassName } from "../utils";
@@ -33,6 +33,7 @@ export default function InputCompact(props) {
33
33
  disabled = props.disabled,
34
34
  _onFocus = props.onFocus,
35
35
  _onBlur = props.onBlur,
36
+ split = props.split,
36
37
  restProps = _objectWithoutProperties(props, _excluded);
37
38
 
38
39
  var inputPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls('input');
@@ -52,8 +53,9 @@ export default function InputCompact(props) {
52
53
  });
53
54
  }
54
55
 
56
+ var status = Form.Item.useStatus();
55
57
  return /*#__PURE__*/React.createElement("div", _extends({
56
- className: classNames(className, prefix(), inputPrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(inputPrefixCls, "-focused"), focused), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames)),
58
+ className: classNames(className, prefix(), inputPrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(inputPrefixCls, "-focused"), focused), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(inputPrefixCls, "-status-error"), status.status === 'error'), _classNames)),
57
59
  onFocus: function onFocus(e) {
58
60
  setFocused(true);
59
61
  _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
@@ -69,7 +71,9 @@ export default function InputCompact(props) {
69
71
  newNode = /*#__PURE__*/cloneElement(node, extraProps);
70
72
  }
71
73
 
72
- return /*#__PURE__*/React.createElement(React.Fragment, null, newNode, /*#__PURE__*/React.createElement("div", {
74
+ return /*#__PURE__*/React.createElement(React.Fragment, null, newNode, split ? /*#__PURE__*/React.createElement("div", {
75
+ className: prefix('split')
76
+ }, split) : /*#__PURE__*/React.createElement("div", {
73
77
  className: prefix('gutter')
74
78
  }));
75
79
  }));
@@ -15,4 +15,19 @@
15
15
  display: none;
16
16
  }
17
17
  }
18
+
19
+ &-split {
20
+ &:last-child {
21
+ display: none;
22
+ }
23
+ }
24
+
25
+ &.@{ant-prefix}-input-status-error {
26
+ .@{ant-prefix}-select-borderless.@{ant-prefix}-select:not(.@{ant-prefix}-select-disabled):not(
27
+ .@{ant-prefix}-select-customize-input
28
+ ):not(.@{ant-prefix}-pagination-size-changer)
29
+ .@{ant-prefix}-select-selector {
30
+ border-color: transparent !important;
31
+ }
32
+ }
18
33
  }
@@ -2,6 +2,9 @@
2
2
  cursor: pointer;
3
3
 
4
4
  &-wrapper {
5
+ width: 100%;
6
+ min-width: 0;
7
+
5
8
  .@{ant-prefix}-input-suffix {
6
9
  position: relative;
7
10
 
@@ -196,7 +196,8 @@ export default function SelectView(props) {
196
196
  }
197
197
 
198
198
  var result = [{
199
- type: 'delete'
199
+ type: 'delete',
200
+ sortable: false
200
201
  }].concat(_toConsumableArray(selectedColumns));
201
202
  return result;
202
203
  }, [selectedColumns, readOnly]);
@@ -253,7 +254,10 @@ export default function SelectView(props) {
253
254
  defaultColDef: defaultColDef,
254
255
  rowHeight: rowHeight,
255
256
  cellDisplayFlex: cellDisplayFlex,
256
- onDataSourceChange: setData,
257
+ onDataSourceChange: function onDataSourceChange(val) {
258
+ setData(val);
259
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
260
+ },
257
261
  columns: mSelectedCols,
258
262
  rowKey: rowKey,
259
263
  pagination: pagination,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-174",
3
+ "version": "1.0.0-176",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",