xmirror-components 1.0.28-alpha.2 → 1.0.28

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.
@@ -52,5 +52,5 @@ export interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
52
52
  */
53
53
  flag?: string | number;
54
54
  }
55
- declare const _default: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
56
- export default _default;
55
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
56
+ export default IconButton;
@@ -24,7 +24,7 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
- import React, { useContext } from 'react';
27
+ import React, { useContext, forwardRef } from 'react';
28
28
  import { Tooltip, Button } from 'antd';
29
29
  import { noop, isString } from 'lodash-es';
30
30
  import classNames from 'classnames';
@@ -44,7 +44,7 @@ var ButtonTooltip = function (_a) {
44
44
  return (React.createElement(Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs), children));
45
45
  }
46
46
  };
47
- var IconButton = function (props, ref) {
47
+ var IconButton = forwardRef(function (props, ref) {
48
48
  var iconButton = useContext(ConfigContext).iconButton;
49
49
  var Icon = props.icon, _a = props.tooltipDisabled, tooltipDisabled = _a === void 0 ? false : _a, title = props.title, _b = props.hide, hide = _b === void 0 ? false : _b, disabledReason = props.disabledReason, _c = props.onClick, onClick = _c === void 0 ? noop : _c, disabled = props.disabled, _d = props.size, size = _d === void 0 ? iconButton.size || 'small' : _d, _e = props.style, style = _e === void 0 ? {} : _e, className = props.className, _f = props.loading, loading = _f === void 0 ? false : _f, attrs = __rest(props, ["icon", "tooltipDisabled", "title", "hide", "disabledReason", "onClick", "disabled", "size", "style", "className", "loading"]);
50
50
  var createIcon = function () {
@@ -62,6 +62,6 @@ var IconButton = function (props, ref) {
62
62
  return (React.createElement(IconButtonRender, __assign({}, props),
63
63
  React.createElement(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs),
64
64
  React.createElement(StyledButton, { ref: ref, icon: createIcon(), size: size, className: classNames(['icon-button', iconButton.className, className]), disabled: disabled, style: __assign(__assign({}, iconButton.style), style), loading: loading, onClick: onClick }))));
65
- };
66
- export default React.forwardRef(IconButton);
65
+ });
66
+ export default IconButton;
67
67
  var templateObject_1;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- import type { TableComponentProps } from '../types';
3
+ import type { TableComponentProps } from '../types.ts';
4
4
  declare function Index(props: TableComponentProps): React.JSX.Element;
5
5
  export default Index;
@@ -5,9 +5,9 @@ import { CSSTransition } from 'react-transition-group';
5
5
  import { CloseOutlined } from '@ant-design/icons';
6
6
  import './index.less';
7
7
  function Index(props) {
8
- var _a, _b, _c;
8
+ var _a;
9
9
  var transitionNodeRef = useRef(null);
10
- var _d = props, pagination = _d.pagination, _e = _d.rowSelection, rowSelection = _e === void 0 ? { selectedRowKeys: [], onChange: function () { } } : _e, _f = _d.dataSource, dataSource = _f === void 0 ? [] : _f, _g = _d.selectionPopover, selectionPopover = _g === void 0 ? false : _g;
10
+ var pagination = props.pagination, _b = props.rowSelection, rowSelection = _b === void 0 ? { selectedRowKeys: [], onChange: function () { } } : _b, _c = props.dataSource, dataSource = _c === void 0 ? [] : _c, _d = props.selectionPopover, selectionPopover = _d === void 0 ? false : _d;
11
11
  /**
12
12
  * 选中所有
13
13
  * @param checked 选中状态
@@ -68,8 +68,9 @@ function Index(props) {
68
68
  return !!(selectedRowKeys.length > 0 && selectedRowKeys.length === optionalNum);
69
69
  }, [rowSelection.selectedRowKeys, optionalNum]);
70
70
  return (React.createElement("div", { className: "table-footer" },
71
- React.createElement(CSSTransition, { in: Boolean(props.rowSelection && props.selectionPopover && (checked || indeterminate)), nodeRef: transitionNodeRef, classNames: "zoom", unmountOnExit: true, timeout: 300 },
72
- React.createElement(Row, { ref: transitionNodeRef, className: "table-batch-dialog", justify: "space-between" },
71
+ React.createElement(CSSTransition, { in: Boolean(props.rowSelection && props.selectionPopover && (checked || indeterminate)), nodeRef: transitionNodeRef, classNames: "zoom", unmountOnExit: true, timeout: 300 }, function () {
72
+ var _a, _b;
73
+ return (React.createElement(Row, { ref: transitionNodeRef, className: "table-batch-dialog", justify: "space-between" },
73
74
  React.createElement(Col, { style: { display: 'flex', alignItems: 'center' } },
74
75
  React.createElement(Checkbox, { checked: checked, indeterminate: indeterminate, onChange: changeCheckAll },
75
76
  React.createElement(FormattedMessage, { id: "component.table.selected", defaultMessage: '已选{length}条', values: {
@@ -78,7 +79,8 @@ function Index(props) {
78
79
  React.createElement(Col, { style: { display: 'flex', alignItems: 'center' } },
79
80
  selectionPopover,
80
81
  React.createElement("span", { className: "btn-close", onClick: function () { changeCheckAll({ target: { checked: false } }); } },
81
- React.createElement(CloseOutlined, null))))),
82
- pagination && (React.createElement("span", { className: "table-footer-total" }, pagination.showTotal ? pagination.showTotal((_c = pagination.total) !== null && _c !== void 0 ? _c : 0, [0, 0]) : null))));
82
+ React.createElement(CloseOutlined, null)))));
83
+ }),
84
+ pagination && (React.createElement("span", { className: "table-footer-total" }, pagination.showTotal ? pagination.showTotal((_a = pagination.total) !== null && _a !== void 0 ? _a : 0, [0, 0]) : null))));
83
85
  }
84
86
  export default Index;
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import React, { useEffect, useMemo, useRef, useState } from 'react';
12
+ import React, { useEffect, useMemo, useRef, useState, forwardRef } from 'react';
13
13
  import { Table, Tooltip } from 'antd';
14
14
  import { useLocalStorageState } from 'ahooks';
15
15
  import { DownOutlined } from '@ant-design/icons';
@@ -186,4 +186,4 @@ function Index(props, ref) {
186
186
  x: 900
187
187
  } }, props, { pagination: paginationProps, columns: renderColumns }))));
188
188
  }
189
- export default React.forwardRef(Index);
189
+ export default forwardRef(Index);
@@ -82,7 +82,7 @@ var ButtonTooltip = function (_a) {
82
82
  return (react_1.default.createElement(antd_1.Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs), children));
83
83
  }
84
84
  };
85
- var IconButton = function (props, ref) {
85
+ var IconButton = (0, react_1.forwardRef)(function (props, ref) {
86
86
  var iconButton = (0, react_1.useContext)(ConfigProvider_1.ConfigContext).iconButton;
87
87
  var Icon = props.icon, _a = props.tooltipDisabled, tooltipDisabled = _a === void 0 ? false : _a, title = props.title, _b = props.hide, hide = _b === void 0 ? false : _b, disabledReason = props.disabledReason, _c = props.onClick, onClick = _c === void 0 ? lodash_es_1.noop : _c, disabled = props.disabled, _d = props.size, size = _d === void 0 ? iconButton.size || 'small' : _d, _e = props.style, style = _e === void 0 ? {} : _e, className = props.className, _f = props.loading, loading = _f === void 0 ? false : _f, attrs = __rest(props, ["icon", "tooltipDisabled", "title", "hide", "disabledReason", "onClick", "disabled", "size", "style", "className", "loading"]);
88
88
  var createIcon = function () {
@@ -100,6 +100,6 @@ var IconButton = function (props, ref) {
100
100
  return (react_1.default.createElement(IconButtonRender, __assign({}, props),
101
101
  react_1.default.createElement(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs),
102
102
  react_1.default.createElement(StyledButton, { ref: ref, icon: createIcon(), size: size, className: (0, classnames_1.default)(['icon-button', iconButton.className, className]), disabled: disabled, style: __assign(__assign({}, iconButton.style), style), loading: loading, onClick: onClick }))));
103
- };
104
- exports.default = react_1.default.forwardRef(IconButton);
103
+ });
104
+ exports.default = IconButton;
105
105
  var templateObject_1;
@@ -40,9 +40,9 @@ var react_transition_group_1 = require("react-transition-group");
40
40
  var icons_1 = require("@ant-design/icons");
41
41
  require("./index.less");
42
42
  function Index(props) {
43
- var _a, _b, _c;
43
+ var _a;
44
44
  var transitionNodeRef = (0, react_1.useRef)(null);
45
- var _d = props, pagination = _d.pagination, _e = _d.rowSelection, rowSelection = _e === void 0 ? { selectedRowKeys: [], onChange: function () { } } : _e, _f = _d.dataSource, dataSource = _f === void 0 ? [] : _f, _g = _d.selectionPopover, selectionPopover = _g === void 0 ? false : _g;
45
+ var pagination = props.pagination, _b = props.rowSelection, rowSelection = _b === void 0 ? { selectedRowKeys: [], onChange: function () { } } : _b, _c = props.dataSource, dataSource = _c === void 0 ? [] : _c, _d = props.selectionPopover, selectionPopover = _d === void 0 ? false : _d;
46
46
  /**
47
47
  * 选中所有
48
48
  * @param checked 选中状态
@@ -103,8 +103,9 @@ function Index(props) {
103
103
  return !!(selectedRowKeys.length > 0 && selectedRowKeys.length === optionalNum);
104
104
  }, [rowSelection.selectedRowKeys, optionalNum]);
105
105
  return (react_1.default.createElement("div", { className: "table-footer" },
106
- react_1.default.createElement(react_transition_group_1.CSSTransition, { in: Boolean(props.rowSelection && props.selectionPopover && (checked || indeterminate)), nodeRef: transitionNodeRef, classNames: "zoom", unmountOnExit: true, timeout: 300 },
107
- react_1.default.createElement(antd_1.Row, { ref: transitionNodeRef, className: "table-batch-dialog", justify: "space-between" },
106
+ react_1.default.createElement(react_transition_group_1.CSSTransition, { in: Boolean(props.rowSelection && props.selectionPopover && (checked || indeterminate)), nodeRef: transitionNodeRef, classNames: "zoom", unmountOnExit: true, timeout: 300 }, function () {
107
+ var _a, _b;
108
+ return (react_1.default.createElement(antd_1.Row, { ref: transitionNodeRef, className: "table-batch-dialog", justify: "space-between" },
108
109
  react_1.default.createElement(antd_1.Col, { style: { display: 'flex', alignItems: 'center' } },
109
110
  react_1.default.createElement(antd_1.Checkbox, { checked: checked, indeterminate: indeterminate, onChange: changeCheckAll },
110
111
  react_1.default.createElement(react_intl_1.FormattedMessage, { id: "component.table.selected", defaultMessage: '已选{length}条', values: {
@@ -113,7 +114,8 @@ function Index(props) {
113
114
  react_1.default.createElement(antd_1.Col, { style: { display: 'flex', alignItems: 'center' } },
114
115
  selectionPopover,
115
116
  react_1.default.createElement("span", { className: "btn-close", onClick: function () { changeCheckAll({ target: { checked: false } }); } },
116
- react_1.default.createElement(icons_1.CloseOutlined, null))))),
117
- pagination && (react_1.default.createElement("span", { className: "table-footer-total" }, pagination.showTotal ? pagination.showTotal((_c = pagination.total) !== null && _c !== void 0 ? _c : 0, [0, 0]) : null))));
117
+ react_1.default.createElement(icons_1.CloseOutlined, null)))));
118
+ }),
119
+ pagination && (react_1.default.createElement("span", { className: "table-footer-total" }, pagination.showTotal ? pagination.showTotal((_a = pagination.total) !== null && _a !== void 0 ? _a : 0, [0, 0]) : null))));
118
120
  }
119
121
  exports.default = Index;
@@ -224,4 +224,4 @@ function Index(props, ref) {
224
224
  x: 900
225
225
  } }, props, { pagination: paginationProps, columns: renderColumns }))));
226
226
  }
227
- exports.default = react_1.default.forwardRef(Index);
227
+ exports.default = (0, react_1.forwardRef)(Index);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmirror-components",
3
- "version": "1.0.28-alpha.2",
3
+ "version": "1.0.28",
4
4
  "type": "module",
5
5
  "main": "build/lib/index.js",
6
6
  "module": "build/es/index.js",
@@ -52,5 +52,5 @@ export interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
52
52
  */
53
53
  flag?: string | number;
54
54
  }
55
- declare const _default: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
56
- export default _default;
55
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
56
+ export default IconButton;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- import type { TableComponentProps } from '../types';
3
+ import type { TableComponentProps } from '../types.ts';
4
4
  declare function Index(props: TableComponentProps): React.JSX.Element;
5
5
  export default Index;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmirror-components",
3
- "version": "1.0.28-alpha.2",
3
+ "version": "1.0.28",
4
4
  "type": "module",
5
5
  "main": "build/lib/index.js",
6
6
  "module": "build/es/index.js",