xmirror-components 1.0.23 → 1.0.25

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.
@@ -1,4 +1,4 @@
1
- import React, { type ForwardedRef } from 'react';
1
+ import React from 'react';
2
2
  interface ButtonTooltipProps {
3
3
  /**
4
4
  * 气泡内容
@@ -52,6 +52,5 @@ interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
52
52
  */
53
53
  [key: string]: any;
54
54
  }
55
- export declare const IconButton: (props: IconButtonProps, buttonRef: ForwardedRef<any>) => React.JSX.Element;
56
- declare const _default: React.FC<IconButtonProps>;
57
- export default _default;
55
+ export declare const IconButton: (props: IconButtonProps) => React.JSX.Element;
56
+ export default IconButton;
@@ -29,7 +29,7 @@ import { Tooltip, Button } from 'antd';
29
29
  import { noop, isString } from 'lodash-es';
30
30
  import IconFont from '../IconFont';
31
31
  import styled from '@emotion/styled';
32
- var StyledButton = styled(Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: 5px;\n font-size: 16px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 16px;\n }\n"], ["\n margin-right: 5px;\n font-size: 16px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 16px;\n }\n"])));
32
+ var StyledButton = styled(Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"], ["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"])));
33
33
  var ButtonTooltip = function (_a) {
34
34
  var children = _a.children, tooltipDisabled = _a.tooltipDisabled, disabled = _a.disabled, disabledReason = _a.disabledReason, title = _a.title, attrs = __rest(_a, ["children", "tooltipDisabled", "disabled", "disabledReason", "title"]);
35
35
  if (tooltipDisabled) {
@@ -39,7 +39,7 @@ var ButtonTooltip = function (_a) {
39
39
  return (React.createElement(Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs), children));
40
40
  }
41
41
  };
42
- export var IconButton = function (props, buttonRef) {
42
+ export var IconButton = function (props) {
43
43
  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 ? '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"]);
44
44
  var createIcon = function () {
45
45
  if (isString(Icon)) {
@@ -53,7 +53,7 @@ export var IconButton = function (props, buttonRef) {
53
53
  console.warn('Icon props not found');
54
54
  }
55
55
  return (React.createElement(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs),
56
- React.createElement(StyledButton, { ref: buttonRef, icon: createIcon(), size: size, className: className, disabled: disabled, style: style, loading: loading, onClick: onClick })));
56
+ React.createElement(StyledButton, { icon: createIcon(), size: size, className: className, disabled: disabled, style: style, loading: loading, onClick: onClick })));
57
57
  };
58
- export default React.forwardRef(IconButton);
58
+ export default IconButton;
59
59
  var templateObject_1;
@@ -1,4 +1,4 @@
1
- import React, { type ForwardedRef } from 'react';
1
+ import React from 'react';
2
2
  interface ButtonTooltipProps {
3
3
  /**
4
4
  * 气泡内容
@@ -52,6 +52,5 @@ interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
52
52
  */
53
53
  [key: string]: any;
54
54
  }
55
- export declare const IconButton: (props: IconButtonProps, buttonRef: ForwardedRef<any>) => React.JSX.Element;
56
- declare const _default: React.FC<IconButtonProps>;
57
- export default _default;
55
+ export declare const IconButton: (props: IconButtonProps) => React.JSX.Element;
56
+ export default IconButton;
@@ -35,7 +35,7 @@ var antd_1 = require("antd");
35
35
  var lodash_es_1 = require("lodash-es");
36
36
  var IconFont_1 = __importDefault(require("../IconFont"));
37
37
  var styled_1 = __importDefault(require("@emotion/styled"));
38
- var StyledButton = (0, styled_1.default)(antd_1.Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: 5px;\n font-size: 16px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 16px;\n }\n"], ["\n margin-right: 5px;\n font-size: 16px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 16px;\n }\n"])));
38
+ var StyledButton = (0, styled_1.default)(antd_1.Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"], ["\n font-size: 18px;\n color: var(--color-primary);\n background-color: transparent;\n border: none;\n box-shadow: initial;\n transition: background-color 0.2s;\n\n &[disabled], &[aria-disabled='true'] {\n color: #9da2a6 !important;\n cursor: not-allowed;\n background-color: transparent;\n }\n\n &:hover, &:active, &:focus {\n background: #F4F0F5;\n }\n\n span {\n font-size: 18px;\n }\n"])));
39
39
  var ButtonTooltip = function (_a) {
40
40
  var children = _a.children, tooltipDisabled = _a.tooltipDisabled, disabled = _a.disabled, disabledReason = _a.disabledReason, title = _a.title, attrs = __rest(_a, ["children", "tooltipDisabled", "disabled", "disabledReason", "title"]);
41
41
  if (tooltipDisabled) {
@@ -45,7 +45,7 @@ var ButtonTooltip = function (_a) {
45
45
  return (react_1.default.createElement(antd_1.Tooltip, __assign({ title: disabled ? disabledReason || title : title }, attrs), children));
46
46
  }
47
47
  };
48
- var IconButton = function (props, buttonRef) {
48
+ var IconButton = function (props) {
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 ? lodash_es_1.noop : _c, disabled = props.disabled, _d = props.size, size = _d === void 0 ? '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 () {
51
51
  if ((0, lodash_es_1.isString)(Icon)) {
@@ -59,8 +59,8 @@ var IconButton = function (props, buttonRef) {
59
59
  console.warn('Icon props not found');
60
60
  }
61
61
  return (react_1.default.createElement(ButtonTooltip, __assign({ tooltipDisabled: tooltipDisabled, hide: hide, disabled: disabled, disabledReason: disabledReason, title: title }, attrs),
62
- react_1.default.createElement(StyledButton, { ref: buttonRef, icon: createIcon(), size: size, className: className, disabled: disabled, style: style, loading: loading, onClick: onClick })));
62
+ react_1.default.createElement(StyledButton, { icon: createIcon(), size: size, className: className, disabled: disabled, style: style, loading: loading, onClick: onClick })));
63
63
  };
64
64
  exports.IconButton = IconButton;
65
- exports.default = react_1.default.forwardRef(exports.IconButton);
65
+ exports.default = exports.IconButton;
66
66
  var templateObject_1;
@@ -77,7 +77,7 @@ declare interface CheckboxValueProps<T = any, F = any> extends Omit<React_2.Comp
77
77
 
78
78
  export declare function GlobalLoading(): React_2.JSX.Element;
79
79
 
80
- export declare const IconButton: React_2.FC<IconButtonProps>;
80
+ export declare const IconButton: (props: IconButtonProps) => React_2.JSX.Element;
81
81
 
82
82
  declare interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
83
83
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmirror-components",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "type": "module",
5
5
  "main": "build/lib/index.js",
6
6
  "module": "build/es/index.js",
@@ -1,4 +1,4 @@
1
- import React, { type ForwardedRef } from 'react';
1
+ import React from 'react';
2
2
  interface ButtonTooltipProps {
3
3
  /**
4
4
  * 气泡内容
@@ -52,6 +52,5 @@ interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
52
52
  */
53
53
  [key: string]: any;
54
54
  }
55
- export declare const IconButton: (props: IconButtonProps, buttonRef: ForwardedRef<any>) => React.JSX.Element;
56
- declare const _default: React.FC<IconButtonProps>;
57
- export default _default;
55
+ export declare const IconButton: (props: IconButtonProps) => React.JSX.Element;
56
+ export default IconButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmirror-components",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "type": "module",
5
5
  "main": "build/lib/index.js",
6
6
  "module": "build/es/index.js",