doui-react 2.0.2 → 2.0.7
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/global-style.js +1 -1
- package/es/api/component/sort.d.ts +1 -1
- package/es/api/component/sort.js +4 -8
- package/es/form/component/utils.d.ts +11 -11
- package/es/grid/component/pagination.d.ts +10 -10
- package/es/icon/hook/index.d.ts +89 -89
- package/es/open-modal/component/modal.js +5 -15
- package/es/open-modal/style/index.js +1 -1
- package/es/open-modal/style/wrap.js +1 -1
- package/es/radio/component/abstract-box.d.ts +25 -25
- 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 +8 -5
- package/es/table/component/utils.d.ts +3 -2
- package/es/table/component/utils.js +18 -6
- package/es/tabs/component/utils.d.ts +3 -3
- package/es/tooltip/component/index.d.ts +11 -12
- package/lib/api/component/global-style.js +1 -1
- package/lib/api/component/sort.d.ts +1 -1
- package/lib/api/component/sort.js +4 -8
- package/lib/form/component/utils.d.ts +11 -11
- package/lib/grid/component/pagination.d.ts +10 -10
- package/lib/icon/hook/index.d.ts +89 -89
- package/lib/open-modal/component/modal.js +3 -13
- package/lib/open-modal/style/index.js +1 -1
- package/lib/open-modal/style/wrap.js +1 -1
- package/lib/radio/component/abstract-box.d.ts +25 -25
- 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 +7 -4
- package/lib/table/component/utils.d.ts +3 -2
- package/lib/table/component/utils.js +18 -6
- package/lib/tabs/component/utils.d.ts +3 -3
- package/lib/tooltip/component/index.d.ts +11 -12
- package/package.json +2 -2
- 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
|
@@ -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
|
});
|
|
@@ -153,8 +160,13 @@ function getRowSelection(_ref3) {
|
|
|
153
160
|
var type = column.type,
|
|
154
161
|
disabled = column.disabled,
|
|
155
162
|
onClick = column.onClick,
|
|
163
|
+
_column$fixed = column.fixed,
|
|
164
|
+
fixed = _column$fixed === void 0 ? 'left' : _column$fixed,
|
|
165
|
+
width = column.width,
|
|
156
166
|
rest = (0, _objectWithoutProperties2.default)(column, _excluded);
|
|
157
167
|
return (0, _objectSpread2.default)({
|
|
168
|
+
fixed: fixed,
|
|
169
|
+
columnWidth: width,
|
|
158
170
|
selectedRowKeys: selectedRowKeys,
|
|
159
171
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
160
172
|
return {
|
|
@@ -222,7 +234,7 @@ function getTableFormInitialValues(_ref5) {
|
|
|
222
234
|
return;
|
|
223
235
|
}
|
|
224
236
|
return _lodash.default.map(dataSource, function (item) {
|
|
225
|
-
return _lodash.default.pick(item, [rowKey].concat((0, _toConsumableArray2.default)(keys)));
|
|
237
|
+
return _lodash.default.pick(item, [rowKey, '__selected__'].concat((0, _toConsumableArray2.default)(keys)));
|
|
226
238
|
});
|
|
227
239
|
}
|
|
228
240
|
function updateDataSourceByFormValues(formValues, dataSource) {
|
|
@@ -6,17 +6,17 @@ 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
|
+
children?: import("react").ReactNode;
|
|
9
10
|
className?: string | undefined;
|
|
10
11
|
style?: import("react").CSSProperties | undefined;
|
|
11
|
-
children?: import("react").ReactNode;
|
|
12
12
|
closable?: boolean | undefined;
|
|
13
13
|
prefixCls?: string | undefined;
|
|
14
14
|
closeIcon?: import("react").ReactNode;
|
|
15
15
|
forceRender?: boolean | undefined;
|
|
16
|
-
disabled?: boolean | undefined;
|
|
17
16
|
id?: string | undefined;
|
|
18
|
-
|
|
17
|
+
disabled?: boolean | undefined;
|
|
19
18
|
icon?: import("react").ReactNode;
|
|
19
|
+
active?: boolean | undefined;
|
|
20
20
|
destroyInactiveTabPane?: boolean | undefined;
|
|
21
21
|
animated?: boolean | undefined;
|
|
22
22
|
tabKey?: string | undefined;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { getPopupContainer } from "../../api";
|
|
3
2
|
import { TooltipProps } from "..";
|
|
4
3
|
export declare const tooltipOverlayClassName: string;
|
|
5
4
|
export declare function getTooltipProps(props: TooltipProps): {
|
|
6
5
|
color?: string | undefined;
|
|
7
6
|
title?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
|
|
8
7
|
overlay?: import("react").ReactNode | import("antd/es/_util/getRenderPropValue").RenderFunction;
|
|
9
|
-
styles?: Partial<Record<"
|
|
10
|
-
classNames: Partial<Record<"
|
|
8
|
+
styles?: Partial<Record<"root" | "body", import("react").CSSProperties>> | undefined;
|
|
9
|
+
classNames: Partial<Record<"root" | "body", string>>;
|
|
11
10
|
style?: import("react").CSSProperties | undefined;
|
|
12
11
|
className?: string | undefined;
|
|
13
12
|
rootClassName?: string | undefined;
|
|
@@ -20,7 +19,7 @@ export declare function getTooltipProps(props: TooltipProps): {
|
|
|
20
19
|
pointAtCenter?: boolean | undefined;
|
|
21
20
|
};
|
|
22
21
|
autoAdjustOverflow?: boolean | import("antd/es/tooltip").AdjustOverflow | undefined;
|
|
23
|
-
getPopupContainer:
|
|
22
|
+
getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
|
|
24
23
|
children?: import("react").ReactNode;
|
|
25
24
|
destroyTooltipOnHide?: boolean | {
|
|
26
25
|
keepParent?: boolean | undefined;
|
|
@@ -34,22 +33,22 @@ export declare function getTooltipProps(props: TooltipProps): {
|
|
|
34
33
|
defaultVisible?: boolean | undefined;
|
|
35
34
|
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
36
35
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
36
|
+
zIndex?: number | undefined;
|
|
37
37
|
animation?: string | undefined;
|
|
38
|
+
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
38
39
|
transitionName?: string | undefined;
|
|
39
40
|
prefixCls?: string | undefined;
|
|
40
|
-
zIndex?: number | undefined;
|
|
41
41
|
forceRender?: boolean | undefined;
|
|
42
42
|
id?: string | undefined;
|
|
43
43
|
align?: import("@rc-component/trigger").AlignType | undefined;
|
|
44
|
-
motion?: import("rc-motion").CSSMotionProps | undefined;
|
|
45
|
-
mouseEnterDelay?: number | undefined;
|
|
46
|
-
mouseLeaveDelay?: number | undefined;
|
|
47
44
|
onPopupAlign?: ((element: HTMLElement, align: import("@rc-component/trigger").AlignType) => void) | undefined;
|
|
48
|
-
overlayClassName?: string | undefined;
|
|
49
|
-
overlayStyle?: import("react").CSSProperties | undefined;
|
|
50
|
-
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
51
|
-
popupVisible?: boolean | undefined;
|
|
52
45
|
fresh?: boolean | undefined;
|
|
46
|
+
mouseLeaveDelay?: number | undefined;
|
|
47
|
+
mouseEnterDelay?: number | undefined;
|
|
48
|
+
popupVisible?: boolean | undefined;
|
|
49
|
+
trigger?: import("@rc-component/trigger").ActionType | import("@rc-component/trigger").ActionType[] | undefined;
|
|
50
|
+
overlayStyle?: import("react").CSSProperties | undefined;
|
|
51
|
+
overlayClassName?: string | undefined;
|
|
53
52
|
getTooltipContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
54
53
|
showArrow?: boolean | import("@rc-component/trigger").ArrowType | undefined;
|
|
55
54
|
arrowContent?: import("react").ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doui-react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "A React UI library based on Ant Design",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,7 +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
|
-
"
|
|
24
|
+
"release": "npm version patch && npm publish",
|
|
25
25
|
"setup": "husky && dumi setup && patch-package",
|
|
26
26
|
"test": "jest --coverage"
|
|
27
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
|
-
}
|