@kdcloudjs/kdesign 1.7.33-stable.2 → 1.7.33-stable.3

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.
@@ -70,6 +70,10 @@ var InternalTextarea = function InternalTextarea(props, ref) {
70
70
  _useState6 = _slicedToArray(_useState5, 2),
71
71
  showNumberMark = _useState6[0],
72
72
  setShowNumberMark = _useState6[1];
73
+ var _useState7 = useState(false),
74
+ _useState8 = _slicedToArray(_useState7, 2),
75
+ numberMarkError = _useState8[0],
76
+ setNumberMarkError = _useState8[1];
73
77
  var resizeTextarea = useCallback(function () {
74
78
  if (!autoSize || !textareaRef.current) {
75
79
  return;
@@ -117,21 +121,25 @@ var InternalTextarea = function InternalTextarea(props, ref) {
117
121
  onChange && onChange(event);
118
122
  };
119
123
  var renderNumberMark = function renderNumberMark() {
120
- var enteredLength = value ? value.length : 0;
121
- if (enteredLength >= maxLength) {
122
- enteredLength = maxLength;
123
- }
124
- if (count && showNumberMark && !disabled && maxLength !== '' && maxLength >= 0) {
125
- var countClass = classNames("".concat(textAreaPrefixCls, "-textarea-mark"), _defineProperty({}, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'));
124
+ if (count && (showNumberMark || numberMarkError) && !disabled && maxLength !== '' && maxLength >= 0) {
125
+ var _classNames;
126
+ var countClass = classNames("".concat(textAreaPrefixCls, "-textarea-mark"), (_classNames = {}, _defineProperty(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'), _defineProperty(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-error"), numberMarkError), _classNames));
126
127
  return /*#__PURE__*/React.createElement("div", {
127
128
  className: countClass
128
- }, enteredLength, "/", maxLength);
129
+ }, value ? value.length : 0, "/", maxLength);
129
130
  }
130
131
  return null;
131
132
  };
132
133
  useEffect(function () {
133
134
  resizeTextarea();
134
135
  }, [value, resizeTextarea]);
136
+ useEffect(function () {
137
+ if (value && maxLength && value.length > maxLength) {
138
+ setNumberMarkError(true);
139
+ } else {
140
+ setNumberMarkError(false);
141
+ }
142
+ }, [value]);
135
143
  useEffect(function () {
136
144
  if (propsValue !== undefined) {
137
145
  setValue(propsValue);
@@ -173,7 +181,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
173
181
  ref: textareaRef,
174
182
  disabled: disabled,
175
183
  style: _extends({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
176
- className: classNames("".concat(prefixCls, "-textarea"), (_classNames2 = {}, _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !allowClear && !hadCount)),
184
+ className: classNames("".concat(prefixCls, "-textarea"), (_classNames2 = {}, _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error' || numberMarkError), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !allowClear && !hadCount)),
177
185
  onChange: handleChange,
178
186
  onFocus: !disabled ? handleFocus : undefined,
179
187
  onBlur: !disabled ? handleBlur : undefined,
@@ -215,6 +215,9 @@ textarea {
215
215
  bottom: 5px;
216
216
  right: 8px;
217
217
  }
218
+ .kd-input-textarea-mark-error {
219
+ color: var(--kd-c-input-color-error, var(--kd-g-color-error, #fb2323));
220
+ }
218
221
  .kd-input-no-resize {
219
222
  resize: none;
220
223
  }
@@ -43,12 +43,16 @@ textarea {
43
43
  font-size: @input-small-font-size-inner;
44
44
  line-height: 18px;
45
45
  background-color: #fff;
46
- }
47
46
 
48
- &-mark-inner {
49
- top: auto;
50
- bottom: 5px;
51
- right: 8px;
47
+ &-inner {
48
+ top: auto;
49
+ bottom: 5px;
50
+ right: 8px;
51
+ }
52
+
53
+ &-error {
54
+ color: @input-error-color;
55
+ }
52
56
  }
53
57
  }
54
58
 
@@ -702,10 +702,10 @@
702
702
  color: var(--kd-c-select-footer-color-text-selected, #0e5fd8);
703
703
  padding: 0 2px;
704
704
  }
705
- .kd-select.topLeft.hidden,
706
- .kd-select.bottomLeft.hidden,
707
- .kd-select.topRight.hidden,
708
- .kd-select.bottomRight.hidden {
705
+ .kd-select-dropdown-panel.topLeft.hidden,
706
+ .kd-select-dropdown-panel.bottomLeft.hidden,
707
+ .kd-select-dropdown-panel.topRight.hidden,
708
+ .kd-select-dropdown-panel.bottomRight.hidden {
709
709
  opacity: 0;
710
710
  visibility: hidden;
711
711
  -webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
@@ -439,12 +439,14 @@
439
439
  }
440
440
  }
441
441
 
442
- &.topLeft.hidden,
443
- &.bottomLeft.hidden,
444
- &.topRight.hidden,
445
- &.bottomRight.hidden {
446
- opacity: 0;
447
- visibility: hidden;
448
- transition: all calc(@transition-duration - 0.1s) @ease;
442
+ &-dropdown-panel {
443
+ &.topLeft.hidden,
444
+ &.bottomLeft.hidden,
445
+ &.topRight.hidden,
446
+ &.bottomRight.hidden {
447
+ opacity: 0;
448
+ visibility: hidden;
449
+ transition: all calc(@transition-duration - 0.1s) @ease;
450
+ }
449
451
  }
450
452
  }
@@ -0,0 +1,3 @@
1
+ import { TableRowDrag, TablePipeline } from '../interface';
2
+ declare function useRowDrag(pipeline: TablePipeline, rowDrag?: TableRowDrag, estimatedRowHeight?: number): void;
3
+ export default useRowDrag;
@@ -0,0 +1,10 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import { features } from '@kdcloudjs/table';
3
+ function useRowDrag(pipeline, rowDrag, estimatedRowHeight) {
4
+ if (rowDrag) {
5
+ pipeline.use(features.rowDrag(_extends({
6
+ rowHeight: estimatedRowHeight
7
+ }, rowDrag)));
8
+ }
9
+ }
10
+ export default useRowDrag;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { TableProps as BaseTableProps, TablePipeline as TP, ArtColumnStaticPart } from '@kdcloudjs/table';
3
- import { SortFeatureOptions, RowDetailFeatureOptions, FilterFeatureOptions, TreeModeFeatureOptions, ColumnDragOptions, ColumnResizeOptions, ContextMenuFeatureOptions, RangeSelectionFeatureOptions, colGroupExtendOption } from '@kdcloudjs/table/es/table/pipeline/features';
3
+ import { SortFeatureOptions, RowDetailFeatureOptions, FilterFeatureOptions, TreeModeFeatureOptions, ColumnDragOptions, ColumnResizeOptions, ContextMenuFeatureOptions, RangeSelectionFeatureOptions, colGroupExtendOption, RowDragFeatureOptions } from '@kdcloudjs/table/es/table/pipeline/features';
4
4
  declare type TablePropsOfComponents = Pick<BaseTableProps, 'components'> & {
5
5
  components?: {
6
6
  /** 复选框 */
@@ -35,6 +35,7 @@ export interface TableProps extends TablePropsOfExtend, TablePropsOfComponents {
35
35
  contextMenu?: IContextMenu;
36
36
  rangeSelection?: TableRangeSelection;
37
37
  columnGroupExtend?: colGroupExtendOption;
38
+ rowDrag?: TableRowDrag;
38
39
  }
39
40
  export declare type RowSelectionType = 'checkbox' | 'radio';
40
41
  export declare type RowSelectionFixed = 'start' | 'end';
@@ -58,4 +59,5 @@ export declare type TableTreeMode = TreeModeFeatureOptions;
58
59
  export declare type TablePipeline = TP;
59
60
  export declare type IContextMenu = boolean | ContextMenuFeatureOptions;
60
61
  export declare type TableRangeSelection = RangeSelectionFeatureOptions;
62
+ export declare type TableRowDrag = RowDragFeatureOptions;
61
63
  export {};
package/es/table/table.js CHANGED
@@ -22,6 +22,7 @@ import useMergeCellHover from './feature/mergeCellHover';
22
22
  import devWarning from '../_utils/devwarning';
23
23
  import useFooterDataSource from './feature/useFooterDataSource';
24
24
  import usecolGroupExtendable from './feature/colGroupExtendable';
25
+ import useRowDrag from './feature/useRowDrag';
25
26
  import getApi from './api';
26
27
  var Table = /*#__PURE__*/forwardRef(function (props, ref) {
27
28
  var columns = props.columns,
@@ -56,7 +57,8 @@ var Table = /*#__PURE__*/forwardRef(function (props, ref) {
56
57
  scrollbarWidth = props.scrollbarWidth,
57
58
  scrollLoad = props.scrollLoad,
58
59
  _props$columnGroupExt = props.columnGroupExtend,
59
- columnGroupExtend = _props$columnGroupExt === void 0 ? {} : _props$columnGroupExt;
60
+ columnGroupExtend = _props$columnGroupExt === void 0 ? {} : _props$columnGroupExt,
61
+ rowDrag = props.rowDrag;
60
62
  var _useContext = useContext(ConfigContext),
61
63
  getPrefixCls = _useContext.getPrefixCls,
62
64
  prefixCls = _useContext.prefixCls,
@@ -104,6 +106,7 @@ var Table = /*#__PURE__*/forwardRef(function (props, ref) {
104
106
  useRangeSelection(pipeline, rangeSelection);
105
107
  useMergeCellHover(pipeline);
106
108
  useFooterDataSource(pipeline, footerDataSource);
109
+ useRowDrag(pipeline, rowDrag, estimatedRowHeight);
107
110
  /* -------------------------------------------------------------------------- */
108
111
  /* after useTablePipeline, merge pipeline.getProps result */
109
112
  /* -------------------------------------------------------------------------- */
@@ -1,4 +1,3 @@
1
- import _typeof from "@babel/runtime-corejs3/helpers/typeof";
2
1
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
3
2
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
4
3
  import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
@@ -173,7 +172,8 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
173
172
  if (TreeMap.has(initValue)) {
174
173
  arr.push(TreeMap.get(initValue));
175
174
  } else {
176
- _typeof(initValue) !== undefined && arr.push({
175
+ ;
176
+ (initValue !== null && initValue !== void 0 ? initValue : '') !== '' && arr.push({
177
177
  key: initValue,
178
178
  title: initValue
179
179
  });
@@ -82,6 +82,10 @@ var InternalTextarea = function InternalTextarea(props, ref) {
82
82
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
83
83
  showNumberMark = _useState6[0],
84
84
  setShowNumberMark = _useState6[1];
85
+ var _useState7 = (0, _react.useState)(false),
86
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
87
+ numberMarkError = _useState8[0],
88
+ setNumberMarkError = _useState8[1];
85
89
  var resizeTextarea = (0, _react.useCallback)(function () {
86
90
  if (!autoSize || !textareaRef.current) {
87
91
  return;
@@ -129,21 +133,25 @@ var InternalTextarea = function InternalTextarea(props, ref) {
129
133
  onChange && onChange(event);
130
134
  };
131
135
  var renderNumberMark = function renderNumberMark() {
132
- var enteredLength = value ? value.length : 0;
133
- if (enteredLength >= maxLength) {
134
- enteredLength = maxLength;
135
- }
136
- if (count && showNumberMark && !disabled && maxLength !== '' && maxLength >= 0) {
137
- var countClass = (0, _classnames.default)("".concat(textAreaPrefixCls, "-textarea-mark"), (0, _defineProperty2.default)({}, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'));
136
+ if (count && (showNumberMark || numberMarkError) && !disabled && maxLength !== '' && maxLength >= 0) {
137
+ var _classNames;
138
+ var countClass = (0, _classnames.default)("".concat(textAreaPrefixCls, "-textarea-mark"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'), (0, _defineProperty2.default)(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-error"), numberMarkError), _classNames));
138
139
  return /*#__PURE__*/_react.default.createElement("div", {
139
140
  className: countClass
140
- }, enteredLength, "/", maxLength);
141
+ }, value ? value.length : 0, "/", maxLength);
141
142
  }
142
143
  return null;
143
144
  };
144
145
  (0, _react.useEffect)(function () {
145
146
  resizeTextarea();
146
147
  }, [value, resizeTextarea]);
148
+ (0, _react.useEffect)(function () {
149
+ if (value && maxLength && value.length > maxLength) {
150
+ setNumberMarkError(true);
151
+ } else {
152
+ setNumberMarkError(false);
153
+ }
154
+ }, [value]);
147
155
  (0, _react.useEffect)(function () {
148
156
  if (propsValue !== undefined) {
149
157
  setValue(propsValue);
@@ -185,7 +193,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
185
193
  ref: textareaRef,
186
194
  disabled: disabled,
187
195
  style: (0, _extends2.default)({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
188
- className: (0, _classnames.default)("".concat(prefixCls, "-textarea"), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), (0, _defineProperty2.default)({}, className, className && !allowClear && !hadCount)),
196
+ className: (0, _classnames.default)("".concat(prefixCls, "-textarea"), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-error"), status === 'error' || numberMarkError), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), (0, _defineProperty2.default)({}, className, className && !allowClear && !hadCount)),
189
197
  onChange: handleChange,
190
198
  onFocus: !disabled ? handleFocus : undefined,
191
199
  onBlur: !disabled ? handleBlur : undefined,
@@ -215,6 +215,9 @@ textarea {
215
215
  bottom: 5px;
216
216
  right: 8px;
217
217
  }
218
+ .kd-input-textarea-mark-error {
219
+ color: var(--kd-c-input-color-error, var(--kd-g-color-error, #fb2323));
220
+ }
218
221
  .kd-input-no-resize {
219
222
  resize: none;
220
223
  }
@@ -43,12 +43,16 @@ textarea {
43
43
  font-size: @input-small-font-size-inner;
44
44
  line-height: 18px;
45
45
  background-color: #fff;
46
- }
47
46
 
48
- &-mark-inner {
49
- top: auto;
50
- bottom: 5px;
51
- right: 8px;
47
+ &-inner {
48
+ top: auto;
49
+ bottom: 5px;
50
+ right: 8px;
51
+ }
52
+
53
+ &-error {
54
+ color: @input-error-color;
55
+ }
52
56
  }
53
57
  }
54
58
 
@@ -702,10 +702,10 @@
702
702
  color: var(--kd-c-select-footer-color-text-selected, #0e5fd8);
703
703
  padding: 0 2px;
704
704
  }
705
- .kd-select.topLeft.hidden,
706
- .kd-select.bottomLeft.hidden,
707
- .kd-select.topRight.hidden,
708
- .kd-select.bottomRight.hidden {
705
+ .kd-select-dropdown-panel.topLeft.hidden,
706
+ .kd-select-dropdown-panel.bottomLeft.hidden,
707
+ .kd-select-dropdown-panel.topRight.hidden,
708
+ .kd-select-dropdown-panel.bottomRight.hidden {
709
709
  opacity: 0;
710
710
  visibility: hidden;
711
711
  -webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
@@ -439,12 +439,14 @@
439
439
  }
440
440
  }
441
441
 
442
- &.topLeft.hidden,
443
- &.bottomLeft.hidden,
444
- &.topRight.hidden,
445
- &.bottomRight.hidden {
446
- opacity: 0;
447
- visibility: hidden;
448
- transition: all calc(@transition-duration - 0.1s) @ease;
442
+ &-dropdown-panel {
443
+ &.topLeft.hidden,
444
+ &.bottomLeft.hidden,
445
+ &.topRight.hidden,
446
+ &.bottomRight.hidden {
447
+ opacity: 0;
448
+ visibility: hidden;
449
+ transition: all calc(@transition-duration - 0.1s) @ease;
450
+ }
449
451
  }
450
452
  }
@@ -0,0 +1,3 @@
1
+ import { TableRowDrag, TablePipeline } from '../interface';
2
+ declare function useRowDrag(pipeline: TablePipeline, rowDrag?: TableRowDrag, estimatedRowHeight?: number): void;
3
+ export default useRowDrag;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
9
+ var _table = require("@kdcloudjs/table");
10
+ function useRowDrag(pipeline, rowDrag, estimatedRowHeight) {
11
+ if (rowDrag) {
12
+ pipeline.use(_table.features.rowDrag((0, _extends2.default)({
13
+ rowHeight: estimatedRowHeight
14
+ }, rowDrag)));
15
+ }
16
+ }
17
+ var _default = useRowDrag;
18
+ exports.default = _default;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { TableProps as BaseTableProps, TablePipeline as TP, ArtColumnStaticPart } from '@kdcloudjs/table';
3
- import { SortFeatureOptions, RowDetailFeatureOptions, FilterFeatureOptions, TreeModeFeatureOptions, ColumnDragOptions, ColumnResizeOptions, ContextMenuFeatureOptions, RangeSelectionFeatureOptions, colGroupExtendOption } from '@kdcloudjs/table/es/table/pipeline/features';
3
+ import { SortFeatureOptions, RowDetailFeatureOptions, FilterFeatureOptions, TreeModeFeatureOptions, ColumnDragOptions, ColumnResizeOptions, ContextMenuFeatureOptions, RangeSelectionFeatureOptions, colGroupExtendOption, RowDragFeatureOptions } from '@kdcloudjs/table/es/table/pipeline/features';
4
4
  declare type TablePropsOfComponents = Pick<BaseTableProps, 'components'> & {
5
5
  components?: {
6
6
  /** 复选框 */
@@ -35,6 +35,7 @@ export interface TableProps extends TablePropsOfExtend, TablePropsOfComponents {
35
35
  contextMenu?: IContextMenu;
36
36
  rangeSelection?: TableRangeSelection;
37
37
  columnGroupExtend?: colGroupExtendOption;
38
+ rowDrag?: TableRowDrag;
38
39
  }
39
40
  export declare type RowSelectionType = 'checkbox' | 'radio';
40
41
  export declare type RowSelectionFixed = 'start' | 'end';
@@ -58,4 +59,5 @@ export declare type TableTreeMode = TreeModeFeatureOptions;
58
59
  export declare type TablePipeline = TP;
59
60
  export declare type IContextMenu = boolean | ContextMenuFeatureOptions;
60
61
  export declare type TableRangeSelection = RangeSelectionFeatureOptions;
62
+ export declare type TableRowDrag = RowDragFeatureOptions;
61
63
  export {};
@@ -32,6 +32,7 @@ var _mergeCellHover = _interopRequireDefault(require("./feature/mergeCellHover")
32
32
  var _devwarning = _interopRequireDefault(require("../_utils/devwarning"));
33
33
  var _useFooterDataSource = _interopRequireDefault(require("./feature/useFooterDataSource"));
34
34
  var _colGroupExtendable = _interopRequireDefault(require("./feature/colGroupExtendable"));
35
+ var _useRowDrag = _interopRequireDefault(require("./feature/useRowDrag"));
35
36
  var _api = _interopRequireDefault(require("./api"));
36
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -68,7 +69,8 @@ var Table = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
68
69
  scrollbarWidth = props.scrollbarWidth,
69
70
  scrollLoad = props.scrollLoad,
70
71
  _props$columnGroupExt = props.columnGroupExtend,
71
- columnGroupExtend = _props$columnGroupExt === void 0 ? {} : _props$columnGroupExt;
72
+ columnGroupExtend = _props$columnGroupExt === void 0 ? {} : _props$columnGroupExt,
73
+ rowDrag = props.rowDrag;
72
74
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
73
75
  getPrefixCls = _useContext.getPrefixCls,
74
76
  prefixCls = _useContext.prefixCls,
@@ -116,6 +118,7 @@ var Table = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
116
118
  (0, _useRangeSelection.default)(pipeline, rangeSelection);
117
119
  (0, _mergeCellHover.default)(pipeline);
118
120
  (0, _useFooterDataSource.default)(pipeline, footerDataSource);
121
+ (0, _useRowDrag.default)(pipeline, rowDrag, estimatedRowHeight);
119
122
  /* -------------------------------------------------------------------------- */
120
123
  /* after useTablePipeline, merge pipeline.getProps result */
121
124
  /* -------------------------------------------------------------------------- */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
3
+ var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
4
4
  var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
5
5
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
6
6
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
  exports.default = void 0;
11
- var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
12
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
13
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
14
13
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
@@ -26,7 +25,7 @@ var _utils = require("../_utils");
26
25
  var _index = require("../index");
27
26
  var _usePopper = _interopRequireDefault(require("../_utils/usePopper"));
28
27
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
30
29
  var INPUT_MIN_WIDTH = 4; // 输入框最小宽度
31
30
  function flattenTreeData(treeData) {
32
31
  var map = new _map.default();
@@ -185,7 +184,8 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
185
184
  if (TreeMap.has(initValue)) {
186
185
  arr.push(TreeMap.get(initValue));
187
186
  } else {
188
- (0, _typeof2.default)(initValue) !== undefined && arr.push({
187
+ ;
188
+ (initValue !== null && initValue !== void 0 ? initValue : '') !== '' && arr.push({
189
189
  key: initValue,
190
190
  title: initValue
191
191
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.7.33-stable.2",
3
+ "version": "1.7.33-stable.3",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [
@@ -78,7 +78,7 @@
78
78
  "@babel/runtime-corejs3": "^7.11.2",
79
79
  "@babel/standalone": "^7.14.3",
80
80
  "@kdcloudjs/kdesign-icons": "^1.0.0",
81
- "@kdcloudjs/table": "1.2.0-canary.6",
81
+ "@kdcloudjs/table": "1.2.0-canary.10",
82
82
  "@popperjs/core": "^2.5.4",
83
83
  "@types/js-cookie": "^3.0.3",
84
84
  "async-validator": "^3.5.1",