@arcblock/ux 2.4.19 → 2.4.22
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.
@@ -19,7 +19,7 @@ var _hook = _interopRequireDefault(require("./hook"));
|
|
19
19
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
21
21
|
|
22
|
-
const _excluded = ["content", "locale", "render"];
|
22
|
+
const _excluded = ["content", "locale", "render", "showTooltip"];
|
23
23
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
25
|
|
@@ -37,7 +37,8 @@ function CopyButton(_ref) {
|
|
37
37
|
let {
|
38
38
|
content,
|
39
39
|
locale,
|
40
|
-
render
|
40
|
+
render,
|
41
|
+
showTooltip
|
41
42
|
} = _ref,
|
42
43
|
rest = _objectWithoutProperties(_ref, _excluded);
|
43
44
|
|
@@ -63,7 +64,7 @@ function CopyButton(_ref) {
|
|
63
64
|
title: texts.copied,
|
64
65
|
placement: "bottom",
|
65
66
|
arrow: true,
|
66
|
-
open: copied,
|
67
|
+
open: copied && showTooltip,
|
67
68
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Check.default, {
|
68
69
|
sx: _objectSpread(_objectSpread({}, iconStyle), {}, {
|
69
70
|
color: _colors.green[500]
|
@@ -90,10 +91,12 @@ function CopyButton(_ref) {
|
|
90
91
|
CopyButton.propTypes = {
|
91
92
|
content: _propTypes.default.string,
|
92
93
|
locale: _propTypes.default.oneOf(['en', 'zh']),
|
93
|
-
render: _propTypes.default.func
|
94
|
+
render: _propTypes.default.func,
|
95
|
+
showTooltip: _propTypes.default.bool
|
94
96
|
};
|
95
97
|
CopyButton.defaultProps = {
|
96
98
|
content: '',
|
97
99
|
locale: 'en',
|
98
|
-
render: undefined
|
100
|
+
render: undefined,
|
101
|
+
showTooltip: true
|
99
102
|
};
|
package/lib/Locale/selector.js
CHANGED
@@ -184,4 +184,4 @@ LocaleSelector.defaultProps = {
|
|
184
184
|
};
|
185
185
|
var _default = LocaleSelector;
|
186
186
|
exports.default = _default;
|
187
|
-
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n\n .trigger {\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 14px;\n\n .trigger-text {\n margin-left: 5px;\n font-size: 14px;\n color: ", ";\n }\n }\n\n .locales {\n background: ", ";\n }\n\n .locale-item {\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n text-align: center;\n color: ", ";\n cursor: pointer;\n display: flex;\n padding: 16px;\n align-items: center;\n .check-icon {\n visibility: hidden;\n margin-right: 4px;\n }\n .check-icon-visible {\n visibility: visible;\n }\n }\n"])), props => (0, _Util.getColor)(props), props => (0, _Util.getBackground)(props), props => (0, _Util.getColor)(props));
|
187
|
+
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n\n .trigger {\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 14px;\n\n .trigger-text {\n margin-left: 5px;\n font-size: 14px;\n color: ", ";\n }\n }\n\n .locales {\n background: ", ";\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);\n }\n\n .locale-item {\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n text-align: center;\n color: ", ";\n cursor: pointer;\n display: flex;\n padding: 16px;\n align-items: center;\n .check-icon {\n visibility: hidden;\n margin-right: 4px;\n }\n .check-icon-visible {\n visibility: visible;\n }\n }\n"])), props => (0, _Util.getColor)(props), props => (0, _Util.getBackground)(props), props => (0, _Util.getColor)(props));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.4.
|
3
|
+
"version": "2.4.22",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -19,11 +19,11 @@
|
|
19
19
|
"lint": "eslint src tests",
|
20
20
|
"build": "babel src --out-dir lib --copy-files --no-copy-ignored",
|
21
21
|
"watch": "babel src --out-dir lib -w --copy-files --no-copy-ignored",
|
22
|
-
"precommit": "CI=1
|
23
|
-
"prepush": "CI=1
|
22
|
+
"precommit": "CI=1 npm run lint",
|
23
|
+
"prepush": "CI=1 npm run lint",
|
24
24
|
"prepublish": "npm run build",
|
25
|
-
"test": "
|
26
|
-
"coverage": "npm run
|
25
|
+
"test": "node tools/jest.js",
|
26
|
+
"coverage": "npm run test -- --coverage"
|
27
27
|
},
|
28
28
|
"bugs": {
|
29
29
|
"url": "https://github.com/ArcBlock/ux/issues"
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"@babel/preset-react": "^7.18.6",
|
40
40
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
41
41
|
"eslint-plugin-react-hooks": "^4.6.0",
|
42
|
-
"jest": "^
|
42
|
+
"jest": "^28.1.3",
|
43
43
|
"moment-timezone": "^0.5.34"
|
44
44
|
},
|
45
45
|
"peerDependencies": {
|
@@ -47,10 +47,10 @@
|
|
47
47
|
"react": ">=18.1.0",
|
48
48
|
"react-ga": "^2.7.0"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "a8e5f9c2a89b99064c6a085b6cc1a3042095ecf4",
|
51
51
|
"dependencies": {
|
52
|
-
"@arcblock/icons": "^2.4.
|
53
|
-
"@arcblock/react-hooks": "^2.4.
|
52
|
+
"@arcblock/icons": "^2.4.22",
|
53
|
+
"@arcblock/react-hooks": "^2.4.22",
|
54
54
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
55
55
|
"@emotion/react": "^11.10.0",
|
56
56
|
"@emotion/styled": "^11.10.0",
|
@@ -5,7 +5,7 @@ import CopyIcon from '@mui/icons-material/ContentCopy';
|
|
5
5
|
import CheckIcon from '@mui/icons-material/Check';
|
6
6
|
import useCopy from './hook';
|
7
7
|
|
8
|
-
export default function CopyButton({ content, locale, render, ...rest }) {
|
8
|
+
export default function CopyButton({ content, locale, render, showTooltip, ...rest }) {
|
9
9
|
const { containerRef, copied, copy, texts } = useCopy({ content, locale });
|
10
10
|
const iconStyle = {
|
11
11
|
fontSize: '1em',
|
@@ -14,7 +14,7 @@ export default function CopyButton({ content, locale, render, ...rest }) {
|
|
14
14
|
const copyButton = (
|
15
15
|
<span title={copied ? '' : texts.copy} {...rest} style={{ height: '1em', ...rest.style }}>
|
16
16
|
{copied ? (
|
17
|
-
<Tooltip title={texts.copied} placement="bottom" arrow open={copied}>
|
17
|
+
<Tooltip title={texts.copied} placement="bottom" arrow open={copied && showTooltip}>
|
18
18
|
<CheckIcon sx={{ ...iconStyle, color: green[500] }} />
|
19
19
|
</Tooltip>
|
20
20
|
) : (
|
@@ -33,10 +33,12 @@ CopyButton.propTypes = {
|
|
33
33
|
content: PropTypes.string,
|
34
34
|
locale: PropTypes.oneOf(['en', 'zh']),
|
35
35
|
render: PropTypes.func,
|
36
|
+
showTooltip: PropTypes.bool,
|
36
37
|
};
|
37
38
|
|
38
39
|
CopyButton.defaultProps = {
|
39
40
|
content: '',
|
40
41
|
locale: 'en',
|
41
42
|
render: undefined,
|
43
|
+
showTooltip: true,
|
42
44
|
};
|