@kdcloudjs/kdesign 1.3.4 → 1.3.5
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 +5 -4
- package/dist/kdesign.css +2 -5
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +3487 -1826
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +8 -8
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/usePopper.d.ts +1 -0
- package/es/_utils/usePopper.js +29 -25
- package/es/anchor/anchor.js +20 -1
- package/es/base-data/style/index.css +1 -0
- package/es/base-data/style/index.less +1 -0
- package/es/form/Field.js +7 -6
- package/es/form/Form.d.ts +1 -0
- package/es/form/Form.js +3 -1
- package/es/form/interface.d.ts +1 -0
- package/es/menu/menu.js +12 -11
- package/es/menu/subMenu.js +58 -57
- package/es/select/select.js +24 -18
- package/es/style/core/reset.less +4 -4
- package/es/style/index.css +0 -4
- package/es/table/feature/useRangeSelection.d.ts +3 -0
- package/es/table/feature/useRangeSelection.js +10 -0
- package/es/table/interface.d.ts +15 -2
- package/es/table/table.js +14 -7
- package/lib/_utils/usePopper.d.ts +1 -0
- package/lib/_utils/usePopper.js +29 -25
- package/lib/anchor/anchor.js +20 -1
- package/lib/base-data/style/index.css +1 -0
- package/lib/base-data/style/index.less +1 -0
- package/lib/form/Field.js +7 -6
- package/lib/form/Form.d.ts +1 -0
- package/lib/form/Form.js +3 -1
- package/lib/form/interface.d.ts +1 -0
- package/lib/menu/menu.js +12 -11
- package/lib/menu/subMenu.js +58 -57
- package/lib/select/select.js +24 -18
- package/lib/style/core/reset.less +4 -4
- package/lib/style/index.css +0 -4
- package/lib/table/feature/useRangeSelection.d.ts +3 -0
- package/lib/table/feature/useRangeSelection.js +21 -0
- package/lib/table/interface.d.ts +15 -2
- package/lib/table/table.js +15 -7
- package/package.json +2 -2
|
@@ -194,10 +194,10 @@ template {
|
|
|
194
194
|
/**
|
|
195
195
|
* Reset scrollbar style
|
|
196
196
|
*/
|
|
197
|
-
::-webkit-scrollbar {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
197
|
+
// ::-webkit-scrollbar {
|
|
198
|
+
// width: 10px !important;
|
|
199
|
+
// height: 10px !important;
|
|
200
|
+
// }
|
|
201
201
|
|
|
202
202
|
::-webkit-scrollbar-button {
|
|
203
203
|
width: 0;
|
package/lib/style/index.css
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _table = require("@kdcloudjs/table");
|
|
13
|
+
|
|
14
|
+
function useRangeSelection(pipeline, rangeSelection) {
|
|
15
|
+
if (rangeSelection) {
|
|
16
|
+
pipeline.use(_table.features.rangeSelection((0, _extends2.default)({}, rangeSelection)));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var _default = useRangeSelection;
|
|
21
|
+
exports.default = _default;
|
package/lib/table/interface.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TableProps as BaseTableProps, TablePipeline as TP, ArtColumnStaticPart } from '@kdcloudjs/table';
|
|
2
|
-
import { SortFeatureOptions, RowDetailFeatureOptions, FilterFeatureOptions, TreeModeFeatureOptions, ColumnDragOptions, ColumnResizeOptions, ContextMenuFeatureOptions } from '@kdcloudjs/table/es/table/pipeline/features';
|
|
3
|
-
|
|
3
|
+
import { SortFeatureOptions, RowDetailFeatureOptions, FilterFeatureOptions, TreeModeFeatureOptions, ColumnDragOptions, ColumnResizeOptions, ContextMenuFeatureOptions, RangeSelectionFeatureOptions } from '@kdcloudjs/table/es/table/pipeline/features';
|
|
4
|
+
declare type TablePropsOfComponents = Pick<BaseTableProps, 'components'> & {
|
|
5
|
+
components?: {
|
|
6
|
+
/** 复选框 */
|
|
7
|
+
Checkbox?: React.ComponentType;
|
|
8
|
+
/** 单选框 */
|
|
9
|
+
Radio?: React.ComponentType;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare type TablePropsOfExtend = Omit<BaseTableProps, 'components'>;
|
|
13
|
+
export interface TableProps extends TablePropsOfExtend, TablePropsOfComponents {
|
|
4
14
|
rowSelection?: TableRowSelection;
|
|
5
15
|
prefixCls?: string;
|
|
6
16
|
rowDetail?: TableRowDetail;
|
|
@@ -11,6 +21,7 @@ export interface TableProps extends BaseTableProps {
|
|
|
11
21
|
columnDrag?: boolean | ColumnDragOptions;
|
|
12
22
|
columnResize?: boolean | ColumnResizeOptions;
|
|
13
23
|
contextMenu?: IContextMenu;
|
|
24
|
+
rangeSelection?: TableRangeSelection;
|
|
14
25
|
}
|
|
15
26
|
export declare type RowSelectionType = 'checkbox' | 'radio';
|
|
16
27
|
export declare type RowSelectionFixed = 'start' | 'end';
|
|
@@ -32,3 +43,5 @@ export declare type TableSort = SortFeatureOptions;
|
|
|
32
43
|
export declare type TableTreeMode = TreeModeFeatureOptions;
|
|
33
44
|
export declare type TablePipeline = TP;
|
|
34
45
|
export declare type IContextMenu = boolean | ContextMenuFeatureOptions;
|
|
46
|
+
export declare type TableRangeSelection = RangeSelectionFeatureOptions;
|
|
47
|
+
export {};
|
package/lib/table/table.js
CHANGED
|
@@ -51,6 +51,8 @@ var _columnDrag = _interopRequireDefault(require("./feature/columnDrag"));
|
|
|
51
51
|
|
|
52
52
|
var _contextMenu = _interopRequireDefault(require("./feature/contextMenu"));
|
|
53
53
|
|
|
54
|
+
var _useRangeSelection = _interopRequireDefault(require("./feature/useRangeSelection"));
|
|
55
|
+
|
|
54
56
|
var _devwarning = _interopRequireDefault(require("../_utils/devwarning"));
|
|
55
57
|
|
|
56
58
|
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); }
|
|
@@ -84,6 +86,7 @@ function Table(props) {
|
|
|
84
86
|
getRowProps = props.getRowProps,
|
|
85
87
|
getTableProps = props.getTableProps,
|
|
86
88
|
contextMenu = props.contextMenu,
|
|
89
|
+
rangeSelection = props.rangeSelection,
|
|
87
90
|
cssVariables = props.cssVariables;
|
|
88
91
|
|
|
89
92
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
@@ -94,19 +97,24 @@ function Table(props) {
|
|
|
94
97
|
var tableCls = (0, _classnames.default)(tablePrefixCls, className);
|
|
95
98
|
var pipeline = (0, _table.useTablePipeline)({
|
|
96
99
|
components: {
|
|
97
|
-
Checkbox: _index.default,
|
|
98
|
-
Radio: _index2.default
|
|
100
|
+
Checkbox: (components === null || components === void 0 ? void 0 : components.Checkbox) || _index.default,
|
|
101
|
+
Radio: (components === null || components === void 0 ? void 0 : components.Radio) || _index2.default
|
|
99
102
|
}
|
|
100
103
|
}).primaryKey(primaryKey === undefined ? '' : primaryKey).input({
|
|
101
104
|
columns: columns,
|
|
102
105
|
dataSource: dataSource
|
|
103
106
|
});
|
|
107
|
+
|
|
108
|
+
if (footerDataSource) {
|
|
109
|
+
pipeline.footerDataSource(footerDataSource);
|
|
110
|
+
}
|
|
104
111
|
/* -------------------------------------------------------------------------- */
|
|
105
112
|
|
|
106
113
|
/* features */
|
|
107
114
|
|
|
108
115
|
/* -------------------------------------------------------------------------- */
|
|
109
116
|
|
|
117
|
+
|
|
110
118
|
(0, _rowSelection.default)(pipeline, rowSelection);
|
|
111
119
|
(0, _rowDetail.default)(pipeline, rowDetail);
|
|
112
120
|
(0, _filter2.default)(pipeline, filter);
|
|
@@ -116,6 +124,7 @@ function Table(props) {
|
|
|
116
124
|
(0, _columnResize.default)(pipeline, columnResize);
|
|
117
125
|
(0, _columnDrag.default)(pipeline, columnDrag);
|
|
118
126
|
(0, _contextMenu.default)(pipeline, contextMenu);
|
|
127
|
+
(0, _useRangeSelection.default)(pipeline, rangeSelection);
|
|
119
128
|
/* -------------------------------------------------------------------------- */
|
|
120
129
|
|
|
121
130
|
/* after useTablePipeline, merge pipeline.getProps result */
|
|
@@ -139,18 +148,17 @@ function Table(props) {
|
|
|
139
148
|
className: tableCls,
|
|
140
149
|
style: style,
|
|
141
150
|
isLoading: isLoading,
|
|
142
|
-
components:
|
|
143
|
-
LoadingIcon: function
|
|
151
|
+
components: {
|
|
152
|
+
LoadingIcon: (components === null || components === void 0 ? void 0 : components.LoadingIcon) || function () {
|
|
144
153
|
return /*#__PURE__*/_react.default.createElement(_index3.Spin, {
|
|
145
154
|
type: "container"
|
|
146
155
|
});
|
|
147
156
|
},
|
|
148
|
-
EmptyContent: function
|
|
157
|
+
EmptyContent: (components === null || components === void 0 ? void 0 : components.EmptyContent) || function () {
|
|
149
158
|
return /*#__PURE__*/_react.default.createElement(_index3.Empty, null);
|
|
150
159
|
}
|
|
151
|
-
},
|
|
160
|
+
},
|
|
152
161
|
useVirtual: useVirtual,
|
|
153
|
-
footerDataSource: footerDataSource,
|
|
154
162
|
estimatedRowHeight: estimatedRowHeight,
|
|
155
163
|
emptyCellHeight: emptyCellHeight,
|
|
156
164
|
hasHeader: hasHeader,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdcloudjs/kdesign",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "KDesign 金蝶前端react 组件库",
|
|
5
5
|
"title": "kdesign",
|
|
6
6
|
"keywords": [
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@babel/runtime": "^7.10.4",
|
|
77
77
|
"@babel/runtime-corejs3": "^7.11.2",
|
|
78
78
|
"@babel/standalone": "^7.14.3",
|
|
79
|
-
"@kdcloudjs/table": "1.
|
|
79
|
+
"@kdcloudjs/table": "^1.1.0",
|
|
80
80
|
"@popperjs/core": "^2.5.4",
|
|
81
81
|
"async-validator": "^3.5.1",
|
|
82
82
|
"axios": "^0.21.1",
|