doui-react 2.0.1 → 2.0.6
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/es/api/component/react-dom.js +11 -7
- package/es/api/component/sort.d.ts +1 -1
- package/es/api/component/sort.js +4 -8
- package/es/checkbox/component/utils.js +1 -1
- package/es/form/component/utils.d.ts +7 -7
- package/es/grid/component/pagination.d.ts +12 -12
- package/es/icon/hook/index.d.ts +254 -254
- package/es/open-modal/component/modal.js +2 -0
- package/es/open-modal/style/index.js +2 -1
- package/es/radio/component/abstract-box.d.ts +31 -31
- package/es/table/component/date-time.d.ts +3 -0
- package/es/table/component/date-time.js +27 -0
- package/es/table/component/filter.js +1 -1
- package/es/table/component/sort.js +1 -1
- package/es/table/component/table.js +11 -2
- package/es/table/component/utils.d.ts +3 -2
- package/es/table/component/utils.js +22 -11
- package/es/tabs/component/utils.d.ts +3 -3
- package/es/tooltip/component/index.d.ts +3 -3
- package/es/virtual-list/component/index.d.ts +1 -1
- package/es/virtual-list/component/index.js +4 -2
- package/es/virtual-list/type/index.d.ts +2 -1
- package/lib/api/component/react-dom.js +13 -9
- package/lib/api/component/sort.d.ts +1 -1
- package/lib/api/component/sort.js +4 -8
- package/lib/checkbox/component/utils.js +1 -1
- package/lib/form/component/utils.d.ts +7 -7
- package/lib/grid/component/pagination.d.ts +12 -12
- package/lib/icon/hook/index.d.ts +254 -254
- package/lib/open-modal/component/modal.js +2 -0
- package/lib/open-modal/style/index.js +2 -1
- package/lib/radio/component/abstract-box.d.ts +39 -39
- package/lib/table/component/date-time.d.ts +3 -0
- package/lib/table/component/date-time.js +35 -0
- package/lib/table/component/filter.js +1 -1
- package/lib/table/component/sort.js +1 -1
- package/lib/table/component/table.js +10 -1
- package/lib/table/component/utils.d.ts +3 -2
- package/lib/table/component/utils.js +22 -11
- package/lib/tabs/component/utils.d.ts +3 -3
- package/lib/tooltip/component/index.d.ts +3 -3
- package/lib/virtual-list/component/index.d.ts +1 -1
- package/lib/virtual-list/component/index.js +4 -2
- package/lib/virtual-list/type/index.d.ts +2 -1
- package/package.json +2 -1
- package/es/table/component/time.d.ts +0 -2
- package/es/table/component/time.js +0 -12
- package/lib/table/component/time.d.ts +0 -2
- package/lib/table/component/time.js +0 -19
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Modal = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _api = require("../../api");
|
|
9
10
|
var _form = require("../../form");
|
|
10
11
|
var _text = require("../../text");
|
|
11
12
|
var _antd = require("antd");
|
|
@@ -41,6 +42,7 @@ var Modal = exports.Modal = function Modal(props) {
|
|
|
41
42
|
}), (0, _jsxRuntime.jsx)(_form.Form, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, formProps), {}, {
|
|
42
43
|
context: context
|
|
43
44
|
})), (0, _jsxRuntime.jsx)(_antd.Divider, {
|
|
45
|
+
className: (0, _api.getClassName)('footer-divider'),
|
|
44
46
|
style: {
|
|
45
47
|
margin: '15px 0 20px'
|
|
46
48
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _api = require("../../api");
|
|
9
10
|
var _react = require("@emotion/react");
|
|
10
11
|
var _templateObject, _templateObject2, _templateObject3;
|
|
11
12
|
function titleStyle(titleCenter) {
|
|
@@ -18,7 +19,7 @@ var style = {
|
|
|
18
19
|
wrapper: function wrapper(_ref) {
|
|
19
20
|
var bodyBottomMargin = _ref.bodyBottomMargin,
|
|
20
21
|
titleCenter = _ref.titleCenter;
|
|
21
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ant-modal-title {\n font-size: 16px;\n ", "\n }\n\n .ant-modal-body {\n padding-bottom: ", ";\n }\n "])), titleStyle(titleCenter), bodyBottomMargin);
|
|
22
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ant-modal-title {\n font-size: 16px;\n ", "\n }\n\n .ant-modal-body {\n padding-bottom: ", ";\n }\n\n &:not(:has(.ant-modal-footer)) {\n .", " {\n display: none;\n }\n }\n "])), titleStyle(titleCenter), bodyBottomMargin, (0, _api.getClassName)('footer-divider'));
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
var _default = exports.default = style;
|
|
@@ -36,24 +36,24 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
36
36
|
defaultVisible?: boolean | undefined;
|
|
37
37
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
38
38
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
39
|
-
|
|
39
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
40
40
|
id?: string | undefined;
|
|
41
|
-
|
|
42
|
-
transitionName?: string | undefined;
|
|
43
|
-
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
41
|
+
prefixCls?: string | undefined;
|
|
44
42
|
zIndex?: number | undefined;
|
|
43
|
+
animation?: string | undefined;
|
|
45
44
|
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
46
|
-
|
|
47
|
-
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
48
|
-
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
49
|
-
fresh?: boolean | undefined;
|
|
50
|
-
mouseLeaveDelay?: number | undefined;
|
|
45
|
+
transitionName?: string | undefined;
|
|
51
46
|
mouseEnterDelay?: number | undefined;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
overlayStyle?: import("react").CSSProperties | undefined;
|
|
47
|
+
mouseLeaveDelay?: number | undefined;
|
|
48
|
+
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
55
49
|
overlayClassName?: string | undefined;
|
|
50
|
+
overlayStyle?: import("react").CSSProperties | undefined;
|
|
51
|
+
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
52
|
+
popupVisible?: boolean | undefined;
|
|
53
|
+
forceRender?: boolean | undefined;
|
|
54
|
+
fresh?: boolean | undefined;
|
|
56
55
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
56
|
+
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
57
57
|
arrowContent?: import("react").ReactNode;
|
|
58
58
|
overlayInnerStyle?: import("react").CSSProperties | undefined;
|
|
59
59
|
};
|
|
@@ -65,40 +65,40 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
65
65
|
value?: any;
|
|
66
66
|
boxTooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
67
67
|
inGroup?: boolean | undefined;
|
|
68
|
-
|
|
69
|
-
prefixCls?: string | undefined;
|
|
68
|
+
title?: string | undefined;
|
|
70
69
|
className?: string | undefined;
|
|
71
|
-
|
|
70
|
+
type?: string | undefined;
|
|
71
|
+
checked?: boolean | undefined;
|
|
72
72
|
disabled?: boolean | undefined;
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
required?: boolean | undefined;
|
|
75
75
|
defaultChecked?: boolean | undefined;
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
autoFocus?: boolean | undefined;
|
|
77
|
+
id?: string | undefined;
|
|
78
|
+
style?: import("react").CSSProperties | undefined;
|
|
79
|
+
tabIndex?: number | undefined;
|
|
80
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
81
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
|
|
78
82
|
onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
79
83
|
onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
80
84
|
onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
id?: string | undefined;
|
|
85
|
-
autoFocus?: boolean | undefined;
|
|
86
|
-
type?: string | undefined;
|
|
85
|
+
prefixCls?: string | undefined;
|
|
86
|
+
rootClassName?: string | undefined;
|
|
87
|
+
indeterminate?: boolean | undefined;
|
|
87
88
|
skipGroup?: boolean | undefined;
|
|
88
|
-
|
|
89
|
+
hidden?: boolean | undefined;
|
|
90
|
+
onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
|
91
|
+
rows?: number | false | undefined;
|
|
89
92
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
90
|
-
'aria-label'?: string | undefined;
|
|
91
|
-
direction?: import("antd/es/config-provider").DirectionType;
|
|
92
93
|
suppressContentEditableWarning?: boolean | undefined;
|
|
93
94
|
suppressHydrationWarning?: boolean | undefined;
|
|
94
95
|
accessKey?: string | undefined;
|
|
95
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" |
|
|
96
|
-
contentEditable?: (boolean | "true" | "false") | "
|
|
96
|
+
autoCapitalize?: (string & {}) | "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
97
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
97
98
|
contextMenu?: string | undefined;
|
|
98
99
|
dir?: string | undefined;
|
|
99
100
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
100
101
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
101
|
-
hidden?: boolean | undefined;
|
|
102
102
|
lang?: string | undefined;
|
|
103
103
|
nonce?: string | undefined;
|
|
104
104
|
slot?: string | undefined;
|
|
@@ -128,13 +128,13 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
128
128
|
results?: number | undefined;
|
|
129
129
|
security?: string | undefined;
|
|
130
130
|
unselectable?: "off" | "on" | undefined;
|
|
131
|
-
inputMode?: "
|
|
131
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
132
132
|
is?: string | undefined;
|
|
133
133
|
exportparts?: string | undefined;
|
|
134
134
|
part?: string | undefined;
|
|
135
135
|
"aria-activedescendant"?: string | undefined;
|
|
136
136
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
137
|
-
"aria-autocomplete"?: "
|
|
137
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
138
138
|
"aria-braillelabel"?: string | undefined;
|
|
139
139
|
"aria-brailleroledescription"?: string | undefined;
|
|
140
140
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -144,27 +144,28 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
144
144
|
"aria-colindextext"?: string | undefined;
|
|
145
145
|
"aria-colspan"?: number | undefined;
|
|
146
146
|
"aria-controls"?: string | undefined;
|
|
147
|
-
"aria-current"?: boolean | "
|
|
147
|
+
"aria-current"?: boolean | "step" | "date" | "time" | "true" | "false" | "page" | "location" | undefined;
|
|
148
148
|
"aria-describedby"?: string | undefined;
|
|
149
149
|
"aria-description"?: string | undefined;
|
|
150
150
|
"aria-details"?: string | undefined;
|
|
151
151
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
152
|
-
"aria-dropeffect"?: "
|
|
152
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
153
153
|
"aria-errormessage"?: string | undefined;
|
|
154
154
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
155
155
|
"aria-flowto"?: string | undefined;
|
|
156
156
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
157
|
-
"aria-haspopup"?: boolean | "
|
|
157
|
+
"aria-haspopup"?: boolean | "menu" | "tree" | "dialog" | "true" | "false" | "grid" | "listbox" | undefined;
|
|
158
158
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
159
159
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
160
160
|
"aria-keyshortcuts"?: string | undefined;
|
|
161
|
+
'aria-label'?: string | undefined;
|
|
161
162
|
"aria-labelledby"?: string | undefined;
|
|
162
163
|
"aria-level"?: number | undefined;
|
|
163
164
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
164
165
|
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
165
166
|
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
166
167
|
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
167
|
-
"aria-orientation"?: "
|
|
168
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
168
169
|
"aria-owns"?: string | undefined;
|
|
169
170
|
"aria-placeholder"?: string | undefined;
|
|
170
171
|
"aria-posinset"?: number | undefined;
|
|
@@ -297,7 +298,6 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
297
298
|
onMouseOverCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
298
299
|
onMouseUp?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
299
300
|
onMouseUpCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
|
|
300
|
-
onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
|
301
301
|
onSelectCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
|
302
302
|
onTouchCancel?: import("react").TouchEventHandler<HTMLElement> | undefined;
|
|
303
303
|
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
|
|
@@ -337,7 +337,7 @@ export declare function useAbstractBox({ refs, boxTooltip, value, onChange, inGr
|
|
|
337
337
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
|
|
338
338
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
339
339
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
|
|
340
|
-
|
|
340
|
+
direction?: import("antd/es/config-provider").DirectionType;
|
|
341
341
|
tooltip?: import("react").ReactNode | import("antd").TooltipProps;
|
|
342
342
|
autoShowTooltip?: boolean | undefined;
|
|
343
343
|
refs?: import("../../api").Refs | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Date = Date;
|
|
8
|
+
exports.DateTime = DateTime;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
13
|
+
function BaseComponent(_ref) {
|
|
14
|
+
var column = _ref.column,
|
|
15
|
+
children = _ref.children;
|
|
16
|
+
var timeFormat = column.timeFormat;
|
|
17
|
+
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
18
|
+
children: (0, _dayjs.default)(children).format(timeFormat)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function mergerTimeFormat(props, timeFormat) {
|
|
22
|
+
return _lodash.default.merge({
|
|
23
|
+
column: {
|
|
24
|
+
timeFormat: timeFormat
|
|
25
|
+
}
|
|
26
|
+
}, props);
|
|
27
|
+
}
|
|
28
|
+
function Date(props) {
|
|
29
|
+
var params = mergerTimeFormat(props, 'YYYY-MM-DD');
|
|
30
|
+
return (0, _jsxRuntime.jsx)(BaseComponent, (0, _objectSpread2.default)({}, params));
|
|
31
|
+
}
|
|
32
|
+
function DateTime(props) {
|
|
33
|
+
var params = mergerTimeFormat(props, 'YYYY-MM-DD hh:mm:ss');
|
|
34
|
+
return (0, _jsxRuntime.jsx)(BaseComponent, (0, _objectSpread2.default)({}, params));
|
|
35
|
+
}
|
|
@@ -45,7 +45,7 @@ function filter(column, search, record) {
|
|
|
45
45
|
var _column$dataIndex = column.dataIndex,
|
|
46
46
|
dataIndex = _column$dataIndex === void 0 ? '' : _column$dataIndex,
|
|
47
47
|
filterBy = column.filterBy;
|
|
48
|
-
var current = record
|
|
48
|
+
var current = _lodash.default.get(record, dataIndex);
|
|
49
49
|
if (_lodash.default.isFunction(filterBy)) {
|
|
50
50
|
return filterBy({
|
|
51
51
|
record: record,
|
|
@@ -106,12 +106,21 @@ function useInit(_ref2) {
|
|
|
106
106
|
selectedRowKeys: selectedRowKeys,
|
|
107
107
|
setSelectedRowKeys: function setSelectedRowKeys() {
|
|
108
108
|
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
109
|
-
|
|
109
|
+
updateSelectedStatus(keys);
|
|
110
|
+
_setSelectedRowKeys(keys);
|
|
110
111
|
},
|
|
111
112
|
operation: operation,
|
|
112
113
|
rowKey: rowKey,
|
|
113
114
|
editorValueKey: editorValueKey
|
|
114
115
|
});
|
|
116
|
+
function updateSelectedStatus(keys) {
|
|
117
|
+
var data = _lodash.default.map(dataSource, function (item) {
|
|
118
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
119
|
+
__selected__: (0, _api.includesNonStrictMode)(keys, item[rowKey])
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
setDataSource(data);
|
|
123
|
+
}
|
|
115
124
|
function refresh() {
|
|
116
125
|
return _refresh.apply(this, arguments);
|
|
117
126
|
}
|
|
@@ -3,15 +3,16 @@ import type { ColumnType } from 'antd/es/table';
|
|
|
3
3
|
import type { TableRowSelection } from 'antd/es/table/interface';
|
|
4
4
|
import { Column, DataSource, GetSearchColumn, TableContext, TableProps } from '../type';
|
|
5
5
|
import { Actions } from './actions';
|
|
6
|
+
import { Date, DateTime } from './date-time';
|
|
6
7
|
import { Editor } from './editor';
|
|
7
8
|
import { Link } from './link';
|
|
8
9
|
import { Switch } from './switch';
|
|
9
|
-
import { Time } from './time';
|
|
10
10
|
interface GenerateColumnsProps extends TableProps {
|
|
11
11
|
getSearchColumn: GetSearchColumn;
|
|
12
12
|
}
|
|
13
13
|
export declare const componentMap: {
|
|
14
|
-
|
|
14
|
+
date: typeof Date;
|
|
15
|
+
dateTime: typeof DateTime;
|
|
15
16
|
link: typeof Link;
|
|
16
17
|
switch: typeof Switch;
|
|
17
18
|
actions: typeof Actions;
|
|
@@ -15,20 +15,22 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
15
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
16
16
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
17
17
|
var _api = require("../../api");
|
|
18
|
+
var _utils = require("../../form/component/utils");
|
|
18
19
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
19
20
|
var _actions = require("./actions");
|
|
20
21
|
var _constant = require("./constant");
|
|
22
|
+
var _dateTime = require("./date-time");
|
|
21
23
|
var _editor = require("./editor");
|
|
22
24
|
var _filter = require("./filter");
|
|
23
25
|
var _link = require("./link");
|
|
24
26
|
var _sort = require("./sort");
|
|
25
27
|
var _switch = require("./switch");
|
|
26
|
-
var _time = require("./time");
|
|
27
28
|
var _wrapper = require("./wrapper");
|
|
28
29
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
29
|
-
var _excluded = ["type", "disabled", "onClick"];
|
|
30
|
+
var _excluded = ["type", "disabled", "onClick", "fixed", "width"];
|
|
30
31
|
var componentMap = exports.componentMap = {
|
|
31
|
-
|
|
32
|
+
date: _dateTime.Date,
|
|
33
|
+
dateTime: _dateTime.DateTime,
|
|
32
34
|
link: _link.Link,
|
|
33
35
|
switch: _switch.Switch,
|
|
34
36
|
actions: _actions.Actions,
|
|
@@ -43,10 +45,13 @@ function generateColumns(_ref) {
|
|
|
43
45
|
getSearchColumn = _ref.getSearchColumn;
|
|
44
46
|
return _lodash.default.map(columns, function (column) {
|
|
45
47
|
var newColumn = _lodash.default.clone(column);
|
|
46
|
-
var
|
|
48
|
+
var dataIndex = newColumn.dataIndex,
|
|
49
|
+
search = newColumn.search,
|
|
47
50
|
sort = newColumn.sort,
|
|
48
51
|
filters = newColumn.filters,
|
|
49
|
-
originRender = newColumn.render
|
|
52
|
+
originRender = newColumn.render,
|
|
53
|
+
_newColumn$align = newColumn.align,
|
|
54
|
+
align = _newColumn$align === void 0 ? 'center' : _newColumn$align;
|
|
50
55
|
_lodash.default.assign(newColumn, getColumnWidth(newColumn));
|
|
51
56
|
if (search) {
|
|
52
57
|
_lodash.default.assign(newColumn, getSearchColumn(column));
|
|
@@ -91,6 +96,8 @@ function generateColumns(_ref) {
|
|
|
91
96
|
return component;
|
|
92
97
|
};
|
|
93
98
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, newColumn), {}, {
|
|
99
|
+
dataIndex: (0, _utils.transformNameToPath)(dataIndex),
|
|
100
|
+
align: align,
|
|
94
101
|
render: render
|
|
95
102
|
});
|
|
96
103
|
});
|
|
@@ -149,13 +156,17 @@ function getRowSelection(_ref3) {
|
|
|
149
156
|
return;
|
|
150
157
|
}
|
|
151
158
|
var selectedRowKeys = context.selectedRowKeys,
|
|
152
|
-
setSelectedRowKeys = context.setSelectedRowKeys
|
|
153
|
-
dataSource = context.dataSource;
|
|
159
|
+
setSelectedRowKeys = context.setSelectedRowKeys;
|
|
154
160
|
var type = column.type,
|
|
155
161
|
disabled = column.disabled,
|
|
156
162
|
onClick = column.onClick,
|
|
163
|
+
_column$fixed = column.fixed,
|
|
164
|
+
fixed = _column$fixed === void 0 ? 'left' : _column$fixed,
|
|
165
|
+
width = column.width,
|
|
157
166
|
rest = (0, _objectWithoutProperties2.default)(column, _excluded);
|
|
158
167
|
return (0, _objectSpread2.default)({
|
|
168
|
+
fixed: fixed,
|
|
169
|
+
columnWidth: width,
|
|
159
170
|
selectedRowKeys: selectedRowKeys,
|
|
160
171
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
161
172
|
return {
|
|
@@ -173,14 +184,14 @@ function getRowSelection(_ref3) {
|
|
|
173
184
|
var rowKeys = keys || _lodash.default.map(selectedRows, rowKey);
|
|
174
185
|
setSelectedRowKeys(rowKeys);
|
|
175
186
|
},
|
|
176
|
-
onSelectAll: function onSelectAll(selected) {
|
|
187
|
+
onSelectAll: function onSelectAll(selected, selectedRows) {
|
|
177
188
|
if (selected) {
|
|
178
|
-
var
|
|
189
|
+
var _selected = _lodash.default.filter(selectedRows, function (record) {
|
|
179
190
|
return !(0, _api.executeFunction)(disabled, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, context), {}, {
|
|
180
191
|
record: record
|
|
181
192
|
}));
|
|
182
193
|
});
|
|
183
|
-
setSelectedRowKeys(_lodash.default.map(
|
|
194
|
+
setSelectedRowKeys(_lodash.default.map(_selected, rowKey));
|
|
184
195
|
return;
|
|
185
196
|
}
|
|
186
197
|
setSelectedRowKeys([]);
|
|
@@ -223,7 +234,7 @@ function getTableFormInitialValues(_ref5) {
|
|
|
223
234
|
return;
|
|
224
235
|
}
|
|
225
236
|
return _lodash.default.map(dataSource, function (item) {
|
|
226
|
-
return _lodash.default.pick(item, [rowKey].concat((0, _toConsumableArray2.default)(keys)));
|
|
237
|
+
return _lodash.default.pick(item, [rowKey, '__selected__'].concat((0, _toConsumableArray2.default)(keys)));
|
|
227
238
|
});
|
|
228
239
|
}
|
|
229
240
|
function updateDataSourceByFormValues(formValues, dataSource) {
|
|
@@ -6,12 +6,12 @@ export declare function getRenderTabBar({ type, items, size, tabBarGutter, tabBa
|
|
|
6
6
|
export declare function generateTabItems({ items }: TabsProps): {
|
|
7
7
|
label: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
8
|
key: string;
|
|
9
|
-
prefixCls?: string | undefined;
|
|
10
9
|
className?: string | undefined;
|
|
11
|
-
style?: import("react").CSSProperties | undefined;
|
|
12
10
|
disabled?: boolean | undefined;
|
|
13
|
-
children?: import("react").ReactNode;
|
|
14
11
|
id?: string | undefined;
|
|
12
|
+
style?: import("react").CSSProperties | undefined;
|
|
13
|
+
children?: import("react").ReactNode;
|
|
14
|
+
prefixCls?: string | undefined;
|
|
15
15
|
closable?: boolean | undefined;
|
|
16
16
|
closeIcon?: import("react").ReactNode;
|
|
17
17
|
active?: boolean | undefined;
|
|
@@ -34,17 +34,17 @@ export declare function getTooltipProps(props: TooltipProps): {
|
|
|
34
34
|
defaultVisible?: boolean | undefined;
|
|
35
35
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
36
36
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
37
|
+
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
38
|
+
id?: string | undefined;
|
|
39
|
+
prefixCls?: string | undefined;
|
|
37
40
|
zIndex?: number | undefined;
|
|
38
41
|
animation?: string | undefined;
|
|
39
42
|
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
40
|
-
id?: string | undefined;
|
|
41
|
-
prefixCls?: string | undefined;
|
|
42
43
|
transitionName?: string | undefined;
|
|
43
44
|
mouseEnterDelay?: number | undefined;
|
|
44
45
|
mouseLeaveDelay?: number | undefined;
|
|
45
46
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
46
47
|
overlayClassName?: string | undefined;
|
|
47
|
-
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
48
48
|
overlayStyle?: import("react").CSSProperties | undefined;
|
|
49
49
|
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
50
50
|
popupVisible?: boolean | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { VirtualListProps } from "..";
|
|
2
|
-
export declare function VirtualList({ data, emptyText, children, ...props }: VirtualListProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function VirtualList({ refs, data, emptyText, children, ...props }: VirtualListProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -11,9 +11,10 @@ var _empty = require("../../empty");
|
|
|
11
11
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
12
12
|
var _reactVirtuoso = require("react-virtuoso");
|
|
13
13
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
|
-
var _excluded = ["data", "emptyText", "children"];
|
|
14
|
+
var _excluded = ["refs", "data", "emptyText", "children"];
|
|
15
15
|
function VirtualList(_ref) {
|
|
16
|
-
var
|
|
16
|
+
var refs = _ref.refs,
|
|
17
|
+
data = _ref.data,
|
|
17
18
|
emptyText = _ref.emptyText,
|
|
18
19
|
children = _ref.children,
|
|
19
20
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -27,6 +28,7 @@ function VirtualList(_ref) {
|
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
return (0, _jsxRuntime.jsx)(_reactVirtuoso.Virtuoso, (0, _objectSpread2.default)({
|
|
31
|
+
ref: refs,
|
|
30
32
|
data: data,
|
|
31
33
|
itemContent: function itemContent(index, item, context) {
|
|
32
34
|
return children(item, index, context);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { BaseComponentProps } from "../../api";
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { VirtuosoProps } from 'react-virtuoso';
|
|
3
|
-
export interface VirtualListProps extends Omit<VirtuosoProps<any, any>, 'children'
|
|
4
|
+
export interface VirtualListProps extends Omit<VirtuosoProps<any, any>, 'children'>, BaseComponentProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 数据
|
|
6
7
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doui-react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "A React UI library based on Ant Design",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"prepare": "if [ -z \"$SKIP_PREPARE\" ]; then yarn setup; fi",
|
|
22
22
|
"prepublishOnly": "yarn lint && yarn build",
|
|
23
23
|
"preview:docs": "dumi preview --port 3060",
|
|
24
|
+
"release": "npm version patch && npm publish",
|
|
24
25
|
"setup": "husky && dumi setup && patch-package",
|
|
25
26
|
"test": "jest --coverage"
|
|
26
27
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
-
var defaultFormat = 'YYYY-MM-DD hh:mm:ss A';
|
|
4
|
-
export function Time(_ref) {
|
|
5
|
-
var column = _ref.column,
|
|
6
|
-
children = _ref.children;
|
|
7
|
-
var timeFormat = column.timeFormat;
|
|
8
|
-
var format = timeFormat || defaultFormat;
|
|
9
|
-
return _jsx(_Fragment, {
|
|
10
|
-
children: dayjs(+children).format(format)
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Time = Time;
|
|
8
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
|
-
var defaultFormat = 'YYYY-MM-DD hh:mm:ss A';
|
|
11
|
-
function Time(_ref) {
|
|
12
|
-
var column = _ref.column,
|
|
13
|
-
children = _ref.children;
|
|
14
|
-
var timeFormat = column.timeFormat;
|
|
15
|
-
var format = timeFormat || defaultFormat;
|
|
16
|
-
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
17
|
-
children: (0, _dayjs.default)(+children).format(format)
|
|
18
|
-
});
|
|
19
|
-
}
|