@yuntijs/ui 1.0.0-beta.91 → 1.0.0-beta.93
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/JsonViewer/index.d.ts +8 -0
- package/es/JsonViewer/index.js +7 -5
- package/es/JsonViewer/style.js +1 -1
- package/package.json +1 -1
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
package/es/JsonViewer/index.d.ts
CHANGED
|
@@ -17,5 +17,13 @@ export interface JsonViewerProps extends JsonViewProps {
|
|
|
17
17
|
* Only workded when fullFeatured=true
|
|
18
18
|
*/
|
|
19
19
|
icon?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The style of the json content
|
|
22
|
+
*/
|
|
23
|
+
contentStyle?: React.CSSProperties;
|
|
24
|
+
classNames?: {
|
|
25
|
+
header?: string;
|
|
26
|
+
content?: string;
|
|
27
|
+
};
|
|
20
28
|
}
|
|
21
29
|
export declare const JsonViewer: React.FC<JsonViewerProps>;
|
package/es/JsonViewer/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["type", "fullFeatured", "title", "icon", "className", "collapseStringMode", "collapsed", "dark", "displaySize", "ignoreLargeArray", "matchesURL", "src", "theme", "style"];
|
|
4
|
+
var _excluded = ["type", "fullFeatured", "title", "icon", "contentStyle", "classNames", "className", "collapseStringMode", "collapsed", "dark", "displaySize", "ignoreLargeArray", "matchesURL", "src", "theme", "style"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import { ActionIcon, CopyButton } from '@lobehub/ui';
|
|
@@ -25,6 +25,8 @@ export var JsonViewer = function JsonViewer(_ref) {
|
|
|
25
25
|
_ref$title = _ref.title,
|
|
26
26
|
title = _ref$title === void 0 ? 'json' : _ref$title,
|
|
27
27
|
icon = _ref.icon,
|
|
28
|
+
contentStyle = _ref.contentStyle,
|
|
29
|
+
classNames = _ref.classNames,
|
|
28
30
|
className = _ref.className,
|
|
29
31
|
_ref$collapseStringMo = _ref.collapseStringMode,
|
|
30
32
|
collapseStringMode = _ref$collapseStringMo === void 0 ? 'directly' : _ref$collapseStringMo,
|
|
@@ -72,7 +74,7 @@ export var JsonViewer = function JsonViewer(_ref) {
|
|
|
72
74
|
vertical: true,
|
|
73
75
|
children: [fullFeatured && /*#__PURE__*/_jsxs(Flex, {
|
|
74
76
|
align: 'center',
|
|
75
|
-
className: styles.header,
|
|
77
|
+
className: cx(styles.header, classNames === null || classNames === void 0 ? void 0 : classNames.header),
|
|
76
78
|
justify: 'space-between',
|
|
77
79
|
children: [/*#__PURE__*/_jsx(ActionIcon, {
|
|
78
80
|
icon: expand ? ChevronDown : ChevronRight,
|
|
@@ -108,13 +110,13 @@ export var JsonViewer = function JsonViewer(_ref) {
|
|
|
108
110
|
}
|
|
109
111
|
})]
|
|
110
112
|
}), /*#__PURE__*/_jsx(Flex, {
|
|
111
|
-
className: styles.content,
|
|
113
|
+
className: cx(styles.content, classNames === null || classNames === void 0 ? void 0 : classNames.content),
|
|
112
114
|
flex: 1,
|
|
113
|
-
style: expand ? {}
|
|
115
|
+
style: expand ? contentStyle : _objectSpread(_objectSpread({}, contentStyle), {}, {
|
|
114
116
|
height: 0,
|
|
115
117
|
padding: 0,
|
|
116
118
|
overflow: 'hidden'
|
|
117
|
-
},
|
|
119
|
+
}),
|
|
118
120
|
children: JsonViewEle
|
|
119
121
|
})]
|
|
120
122
|
});
|
package/es/JsonViewer/style.js
CHANGED
|
@@ -11,7 +11,7 @@ export var useStyles = createStyles(function (_ref, type) {
|
|
|
11
11
|
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n "])), isBlock ? token.colorFillTertiary : 'transparent', isBlock ? token.colorFillTertiary : token.colorFillQuaternary);
|
|
12
12
|
return {
|
|
13
13
|
container: cx(prefix, type !== 'pure' && typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n &:hover {\n .json-view {\n /* show root copy always when hover */\n & > .json-view--copy:first-of-type {\n display: inline !important;\n }\n }\n }\n "])), token.borderRadius, token.motionEaseOut)),
|
|
14
|
-
content: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: ", "px;\n "])), type === 'pure' ? 0 : token.padding),
|
|
14
|
+
content: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n cursor: text;\n user-select: text;\n\n overflow: auto;\n\n width: 100%;\n height: 100%;\n padding: ", "px;\n "])), type === 'pure' ? 0 : token.padding),
|
|
15
15
|
header: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-block: 4px;\n padding-inline: 8px;\n background: ", ";\n "])), token.colorFillQuaternary),
|
|
16
16
|
title: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n user-select: none;\n overflow: hidden;\n margin: 0 ", "px;\n "])), token.margin),
|
|
17
17
|
titleText: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n font-size: ", "px;\n .", "-typography {\n color: ", ";\n }\n "])), token.fontSize, prefixCls, token.colorTextDescription)
|