@kdcloudjs/kdesign 1.7.42 → 1.7.44
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/dist/kdesign-complete.less +0 -4
- package/dist/kdesign.css +1 -5
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +468 -22
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +6 -6
- package/dist/kdesign.min.js.map +1 -1
- package/es/checkbox/checkbox.js +7 -7
- package/es/checkbox/style/index.css +0 -4
- package/es/checkbox/style/index.less +0 -4
- package/es/select/select.js +1 -1
- package/es/table/feature/useRowDrag.d.ts +3 -0
- package/es/table/feature/useRowDrag.js +10 -0
- package/es/table/interface.d.ts +3 -1
- package/es/table/table.js +4 -1
- package/es/tree/tree.js +3 -2
- package/lib/checkbox/checkbox.js +7 -7
- package/lib/checkbox/style/index.css +0 -4
- package/lib/checkbox/style/index.less +0 -4
- package/lib/select/select.js +1 -1
- package/lib/table/feature/useRowDrag.d.ts +3 -0
- package/lib/table/feature/useRowDrag.js +18 -0
- package/lib/table/interface.d.ts +3 -1
- package/lib/table/table.js +4 -1
- package/lib/tree/tree.js +3 -2
- package/package.json +2 -2
package/es/checkbox/checkbox.js
CHANGED
|
@@ -20,7 +20,7 @@ import isBoolean from 'lodash/isBoolean';
|
|
|
20
20
|
import Icon from '../icon';
|
|
21
21
|
import devWarning from '../_utils/devwarning';
|
|
22
22
|
var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
23
|
-
var _context, _context2, _context3, _classNames, _context4, _context5, _context6, _context7, _classNames2, _context8, _context9, _context10, _context11, _context12, _context13, _context14,
|
|
23
|
+
var _context, _context2, _context3, _classNames, _context4, _context5, _context6, _context7, _classNames2, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _classNames4, _context15, _context16, _context17, _classNames5, _context18;
|
|
24
24
|
var _useContext = useContext(ConfigContext),
|
|
25
25
|
getPrefixCls = _useContext.getPrefixCls,
|
|
26
26
|
prefixCls = _useContext.prefixCls,
|
|
@@ -67,9 +67,9 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
67
67
|
var getSquareClassName = classNames(className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames2, _concatInstanceProperty(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), _defineProperty(_classNames2, _concatInstanceProperty(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedSize), !!children), _defineProperty(_classNames2, _concatInstanceProperty(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames2, _concatInstanceProperty(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-checked"), selected && !mergedDisabled), _defineProperty(_classNames2, "checked", selected), _classNames2));
|
|
68
68
|
var getRootClassName = isDefaultType() ? getDefaultClassName : getSquareClassName;
|
|
69
69
|
var inputClassName = classNames(_defineProperty({}, "".concat(checkboxPrefixCls, "-input"), true));
|
|
70
|
-
var checkedWrapperClassName = classNames((_classNames4 = {}, _defineProperty(_classNames4, _concatInstanceProperty(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-
|
|
71
|
-
var triangleClassName = classNames((_classNames5 = {}, _defineProperty(_classNames5, _concatInstanceProperty(
|
|
72
|
-
var innerIconClassName = classNames(_defineProperty({}, _concatInstanceProperty(
|
|
70
|
+
var checkedWrapperClassName = classNames((_classNames4 = {}, _defineProperty(_classNames4, _concatInstanceProperty(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-wrapper"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context9 = "".concat(checkboxPrefixCls, "-")).call(_context9, mergedCheckboxType, "-wrapper-size"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context10 = "".concat(checkboxPrefixCls, "-")).call(_context10, mergedCheckboxType, "-margin"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context11 = "".concat(checkboxPrefixCls, "-")).call(_context11, mergedCheckboxType, "-checked"), selected), _defineProperty(_classNames4, _concatInstanceProperty(_context12 = "".concat(checkboxPrefixCls, "-")).call(_context12, mergedCheckboxType, "-indeterminate"), getIndeterminate()), _defineProperty(_classNames4, _concatInstanceProperty(_context13 = "".concat(checkboxPrefixCls, "-")).call(_context13, mergedCheckboxType, "-disabled"), mergedDisabled && !selected), _defineProperty(_classNames4, _concatInstanceProperty(_context14 = "".concat(checkboxPrefixCls, "-")).call(_context14, mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
|
|
71
|
+
var triangleClassName = classNames((_classNames5 = {}, _defineProperty(_classNames5, _concatInstanceProperty(_context15 = "".concat(checkboxPrefixCls, "-")).call(_context15, mergedCheckboxType, "-triangle"), !selected), _defineProperty(_classNames5, _concatInstanceProperty(_context16 = "".concat(checkboxPrefixCls, "-")).call(_context16, mergedCheckboxType, "-triangle-checked"), selected), _defineProperty(_classNames5, _concatInstanceProperty(_context17 = "".concat(checkboxPrefixCls, "-")).call(_context17, mergedCheckboxType, "-triangle-disabled"), mergedDisabled), _classNames5));
|
|
72
|
+
var innerIconClassName = classNames(_defineProperty({}, _concatInstanceProperty(_context18 = "".concat(checkboxPrefixCls, "-")).call(_context18, mergedCheckboxType, "-inner"), true));
|
|
73
73
|
var handleChange = function handleChange(e) {
|
|
74
74
|
onChange && onChange(e);
|
|
75
75
|
(checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked, e));
|
|
@@ -96,7 +96,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
96
96
|
};
|
|
97
97
|
}, []);
|
|
98
98
|
var getDefaultCheckbox = function getDefaultCheckbox() {
|
|
99
|
-
var
|
|
99
|
+
var _context19, _context20;
|
|
100
100
|
var inputProps = {
|
|
101
101
|
type: 'checkbox',
|
|
102
102
|
className: inputClassName,
|
|
@@ -121,7 +121,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
121
121
|
className: innerIconClassName
|
|
122
122
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
123
123
|
type: "right-bold",
|
|
124
|
-
className: _concatInstanceProperty(
|
|
124
|
+
className: _concatInstanceProperty(_context19 = "".concat(checkboxPrefixCls, "-")).call(_context19, mergedCheckboxType, "-inner-icon")
|
|
125
125
|
})) : null, /*#__PURE__*/React.createElement("input", _extends({
|
|
126
126
|
type: "checkbox",
|
|
127
127
|
ref: ref
|
|
@@ -133,7 +133,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
133
133
|
className: innerIconClassName
|
|
134
134
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
135
135
|
type: "right-bold",
|
|
136
|
-
className: _concatInstanceProperty(
|
|
136
|
+
className: _concatInstanceProperty(_context20 = "".concat(checkboxPrefixCls, "-")).call(_context20, mergedCheckboxType, "-inner-icon")
|
|
137
137
|
}))) : null)
|
|
138
138
|
);
|
|
139
139
|
};
|
|
@@ -334,10 +334,6 @@
|
|
|
334
334
|
.kd-checkbox-default-margin {
|
|
335
335
|
margin-right: var(--kd-c-checkbox-default-input-spacing-margin-right, 4px);
|
|
336
336
|
}
|
|
337
|
-
.kd-checkbox-default-no-child {
|
|
338
|
-
height: 100%;
|
|
339
|
-
width: 100%;
|
|
340
|
-
}
|
|
341
337
|
.kd-checkbox-default-checked-disabled {
|
|
342
338
|
background-color: var(--kd-c-checkbox-default-color-background-disabled, #e5e5e5) !important;
|
|
343
339
|
border-color: var(--kd-c-checkbox-default-color-background-disabled, #d9d9d9) !important;
|
|
@@ -200,10 +200,6 @@
|
|
|
200
200
|
&-margin {
|
|
201
201
|
margin-right: @checkbox-default-input-margin-right;
|
|
202
202
|
}
|
|
203
|
-
&-no-child {
|
|
204
|
-
height: 100%;
|
|
205
|
-
width: 100%;
|
|
206
|
-
}
|
|
207
203
|
&-checked-disabled {
|
|
208
204
|
background-color: @checkbox-default-disabled-color-bg !important;
|
|
209
205
|
border-color: @checkbox-default-disabled-color-border !important;
|
package/es/select/select.js
CHANGED
|
@@ -568,7 +568,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
568
568
|
background: 'none'
|
|
569
569
|
};
|
|
570
570
|
var indeterminate = mulOptions.length > 0 && mulOptions.length < filledOptions.length;
|
|
571
|
-
var checked = mulOptions.length === filledOptions.length;
|
|
571
|
+
var checked = mulOptions.length > 0 && mulOptions.length === filledOptions.length;
|
|
572
572
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
573
573
|
className: dropDownCls,
|
|
574
574
|
style: dropdownStyle,
|
|
@@ -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;
|
package/es/table/interface.d.ts
CHANGED
|
@@ -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
|
/* -------------------------------------------------------------------------- */
|
package/es/tree/tree.js
CHANGED
|
@@ -188,8 +188,9 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
188
188
|
}
|
|
189
189
|
}, [filterData, scrollKey, virtual]);
|
|
190
190
|
var handleNodeLoad = useCallback(function (loadedKeys, loadingKeys, data) {
|
|
191
|
-
var key = data.key
|
|
192
|
-
|
|
191
|
+
var key = data.key,
|
|
192
|
+
isLeaf = data.isLeaf;
|
|
193
|
+
if (!loadData || loadedKeys.has(key) || loadingKeys.has(key) || isLeaf) {
|
|
193
194
|
return;
|
|
194
195
|
}
|
|
195
196
|
setLoadingKeys(function (prevLoadingKeys) {
|
package/lib/checkbox/checkbox.js
CHANGED
|
@@ -32,7 +32,7 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
32
32
|
return t;
|
|
33
33
|
};
|
|
34
34
|
var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
35
|
-
var _context, _context2, _context3, _classNames, _context4, _context5, _context6, _context7, _classNames2, _context8, _context9, _context10, _context11, _context12, _context13, _context14,
|
|
35
|
+
var _context, _context2, _context3, _classNames, _context4, _context5, _context6, _context7, _classNames2, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _classNames4, _context15, _context16, _context17, _classNames5, _context18;
|
|
36
36
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
37
37
|
getPrefixCls = _useContext.getPrefixCls,
|
|
38
38
|
prefixCls = _useContext.prefixCls,
|
|
@@ -79,9 +79,9 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
79
79
|
var getSquareClassName = (0, _classnames.default)(className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(checkboxPrefixCls), true), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedSize), !!children), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-disabled"), mergedDisabled), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-checked"), selected && !mergedDisabled), (0, _defineProperty2.default)(_classNames2, "checked", selected), _classNames2));
|
|
80
80
|
var getRootClassName = isDefaultType() ? getDefaultClassName : getSquareClassName;
|
|
81
81
|
var inputClassName = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(checkboxPrefixCls, "-input"), true));
|
|
82
|
-
var checkedWrapperClassName = (0, _classnames.default)((_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-
|
|
83
|
-
var triangleClassName = (0, _classnames.default)((_classNames5 = {}, (0, _defineProperty2.default)(_classNames5, (0, _concat.default)(
|
|
84
|
-
var innerIconClassName = (0, _classnames.default)((0, _defineProperty2.default)({}, (0, _concat.default)(
|
|
82
|
+
var checkedWrapperClassName = (0, _classnames.default)((_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-wrapper"), true), (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context9 = "".concat(checkboxPrefixCls, "-")).call(_context9, mergedCheckboxType, "-wrapper-size"), true), (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context10 = "".concat(checkboxPrefixCls, "-")).call(_context10, mergedCheckboxType, "-margin"), !!children), (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context11 = "".concat(checkboxPrefixCls, "-")).call(_context11, mergedCheckboxType, "-checked"), selected), (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context12 = "".concat(checkboxPrefixCls, "-")).call(_context12, mergedCheckboxType, "-indeterminate"), getIndeterminate()), (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context13 = "".concat(checkboxPrefixCls, "-")).call(_context13, mergedCheckboxType, "-disabled"), mergedDisabled && !selected), (0, _defineProperty2.default)(_classNames4, (0, _concat.default)(_context14 = "".concat(checkboxPrefixCls, "-")).call(_context14, mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
|
|
83
|
+
var triangleClassName = (0, _classnames.default)((_classNames5 = {}, (0, _defineProperty2.default)(_classNames5, (0, _concat.default)(_context15 = "".concat(checkboxPrefixCls, "-")).call(_context15, mergedCheckboxType, "-triangle"), !selected), (0, _defineProperty2.default)(_classNames5, (0, _concat.default)(_context16 = "".concat(checkboxPrefixCls, "-")).call(_context16, mergedCheckboxType, "-triangle-checked"), selected), (0, _defineProperty2.default)(_classNames5, (0, _concat.default)(_context17 = "".concat(checkboxPrefixCls, "-")).call(_context17, mergedCheckboxType, "-triangle-disabled"), mergedDisabled), _classNames5));
|
|
84
|
+
var innerIconClassName = (0, _classnames.default)((0, _defineProperty2.default)({}, (0, _concat.default)(_context18 = "".concat(checkboxPrefixCls, "-")).call(_context18, mergedCheckboxType, "-inner"), true));
|
|
85
85
|
var handleChange = function handleChange(e) {
|
|
86
86
|
onChange && onChange(e);
|
|
87
87
|
(checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked, e));
|
|
@@ -108,7 +108,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
108
108
|
};
|
|
109
109
|
}, []);
|
|
110
110
|
var getDefaultCheckbox = function getDefaultCheckbox() {
|
|
111
|
-
var
|
|
111
|
+
var _context19, _context20;
|
|
112
112
|
var inputProps = {
|
|
113
113
|
type: 'checkbox',
|
|
114
114
|
className: inputClassName,
|
|
@@ -133,7 +133,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
133
133
|
className: innerIconClassName
|
|
134
134
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
135
135
|
type: "right-bold",
|
|
136
|
-
className: (0, _concat.default)(
|
|
136
|
+
className: (0, _concat.default)(_context19 = "".concat(checkboxPrefixCls, "-")).call(_context19, mergedCheckboxType, "-inner-icon")
|
|
137
137
|
})) : null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({
|
|
138
138
|
type: "checkbox",
|
|
139
139
|
ref: ref
|
|
@@ -145,7 +145,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
145
145
|
className: innerIconClassName
|
|
146
146
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
147
147
|
type: "right-bold",
|
|
148
|
-
className: (0, _concat.default)(
|
|
148
|
+
className: (0, _concat.default)(_context20 = "".concat(checkboxPrefixCls, "-")).call(_context20, mergedCheckboxType, "-inner-icon")
|
|
149
149
|
}))) : null)
|
|
150
150
|
);
|
|
151
151
|
};
|
|
@@ -334,10 +334,6 @@
|
|
|
334
334
|
.kd-checkbox-default-margin {
|
|
335
335
|
margin-right: var(--kd-c-checkbox-default-input-spacing-margin-right, 4px);
|
|
336
336
|
}
|
|
337
|
-
.kd-checkbox-default-no-child {
|
|
338
|
-
height: 100%;
|
|
339
|
-
width: 100%;
|
|
340
|
-
}
|
|
341
337
|
.kd-checkbox-default-checked-disabled {
|
|
342
338
|
background-color: var(--kd-c-checkbox-default-color-background-disabled, #e5e5e5) !important;
|
|
343
339
|
border-color: var(--kd-c-checkbox-default-color-background-disabled, #d9d9d9) !important;
|
|
@@ -200,10 +200,6 @@
|
|
|
200
200
|
&-margin {
|
|
201
201
|
margin-right: @checkbox-default-input-margin-right;
|
|
202
202
|
}
|
|
203
|
-
&-no-child {
|
|
204
|
-
height: 100%;
|
|
205
|
-
width: 100%;
|
|
206
|
-
}
|
|
207
203
|
&-checked-disabled {
|
|
208
204
|
background-color: @checkbox-default-disabled-color-bg !important;
|
|
209
205
|
border-color: @checkbox-default-disabled-color-border !important;
|
package/lib/select/select.js
CHANGED
|
@@ -580,7 +580,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
580
580
|
background: 'none'
|
|
581
581
|
};
|
|
582
582
|
var indeterminate = mulOptions.length > 0 && mulOptions.length < filledOptions.length;
|
|
583
|
-
var checked = mulOptions.length === filledOptions.length;
|
|
583
|
+
var checked = mulOptions.length > 0 && mulOptions.length === filledOptions.length;
|
|
584
584
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
585
585
|
className: dropDownCls,
|
|
586
586
|
style: dropdownStyle,
|
|
@@ -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;
|
package/lib/table/interface.d.ts
CHANGED
|
@@ -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/lib/table/table.js
CHANGED
|
@@ -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
|
/* -------------------------------------------------------------------------- */
|
package/lib/tree/tree.js
CHANGED
|
@@ -200,8 +200,9 @@ var InternalTree = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
200
200
|
}
|
|
201
201
|
}, [filterData, scrollKey, virtual]);
|
|
202
202
|
var handleNodeLoad = (0, _react.useCallback)(function (loadedKeys, loadingKeys, data) {
|
|
203
|
-
var key = data.key
|
|
204
|
-
|
|
203
|
+
var key = data.key,
|
|
204
|
+
isLeaf = data.isLeaf;
|
|
205
|
+
if (!loadData || loadedKeys.has(key) || loadingKeys.has(key) || isLeaf) {
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
207
208
|
setLoadingKeys(function (prevLoadingKeys) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdcloudjs/kdesign",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.44",
|
|
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.
|
|
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",
|