@zat-design/sisyphus-react 3.9.5-beta.9 → 3.9.6
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/dist/index.esm.css +50 -6
- package/dist/less.esm.css +50 -6
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +8 -0
- package/es/ProLayout/components/ProHeader/index.js +94 -28
- package/es/ProLayout/components/ProHeader/style/index.less +51 -6
- package/es/ProLayout/components/ProHeader/utils/index.d.ts +5 -0
- package/es/ProLayout/components/ProHeader/utils/index.js +14 -0
- package/es/ProLayout/style/index.less +1 -1
- package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +8 -0
- package/lib/ProLayout/components/ProHeader/index.js +90 -24
- package/lib/ProLayout/components/ProHeader/style/index.less +51 -6
- package/lib/ProLayout/components/ProHeader/utils/index.d.ts +5 -0
- package/lib/ProLayout/components/ProHeader/utils/index.js +20 -0
- package/lib/ProLayout/style/index.less +1 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
package/dist/index.esm.css
CHANGED
@@ -854,7 +854,7 @@
|
|
854
854
|
background: var(--zaui-disabled-bg);
|
855
855
|
}
|
856
856
|
.pro-header {
|
857
|
-
padding:
|
857
|
+
padding: 10px 0 0 0 !important;
|
858
858
|
background-color: var(--zaui-base-bg, #ffffff);
|
859
859
|
-webkit-box-shadow: 2px 3px 8px 0px rgba(0, 55, 93, 0.1);
|
860
860
|
box-shadow: 2px 3px 8px 0px rgba(0, 55, 93, 0.1);
|
@@ -881,9 +881,44 @@
|
|
881
881
|
.pro-header.pro-header-fixed.pro-header-no-describe .pro-header-top {
|
882
882
|
padding-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1) - var(--zaui-space-size-xs, 4px) * var(--zaui-size, 1));
|
883
883
|
}
|
884
|
+
.pro-header .pro-header-describe {
|
885
|
+
-webkit-transition: height 0.2s ease-in-out;
|
886
|
+
transition: height 0.2s ease-in-out;
|
887
|
+
}
|
884
888
|
.pro-header .pro-header-describe a {
|
885
889
|
color: var(--zaui-link, #006aff);
|
886
890
|
}
|
891
|
+
.pro-header .pro-header-describe .pro-header-describe-items-calc {
|
892
|
+
position: relative;
|
893
|
+
}
|
894
|
+
.pro-header .pro-header-describe.pro-header-describe-hidden {
|
895
|
+
height: 0;
|
896
|
+
padding: 0;
|
897
|
+
overflow: hidden;
|
898
|
+
border: 0;
|
899
|
+
}
|
900
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-label {
|
901
|
+
font-weight: normal;
|
902
|
+
}
|
903
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value {
|
904
|
+
font-weight: 600;
|
905
|
+
}
|
906
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .ant-space-item {
|
907
|
+
font-weight: 600;
|
908
|
+
}
|
909
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .pro-header-describe-items span:first-child {
|
910
|
+
margin-right: 2px;
|
911
|
+
}
|
912
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .pro-header-describe-items .pro-header-describe-items-omit {
|
913
|
+
position: absolute;
|
914
|
+
right: 0;
|
915
|
+
background: #fff;
|
916
|
+
}
|
917
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .pro-header-describe-items.pro-header-describe-items-more .pro-header-tag {
|
918
|
+
padding: 0;
|
919
|
+
background: #fff;
|
920
|
+
color: #333;
|
921
|
+
}
|
887
922
|
.pro-header .pro-header-copy {
|
888
923
|
display: -webkit-box;
|
889
924
|
display: -webkit-flex;
|
@@ -1167,7 +1202,13 @@
|
|
1167
1202
|
font-size: var(--zaui-font-size, 14px);
|
1168
1203
|
}
|
1169
1204
|
.pro-header .pro-header-describe li {
|
1170
|
-
|
1205
|
+
-webkit-box-flex: 0;
|
1206
|
+
-webkit-flex: 0 0 auto;
|
1207
|
+
-ms-flex: 0 0 auto;
|
1208
|
+
flex: 0 0 auto;
|
1209
|
+
white-space: nowrap;
|
1210
|
+
overflow: hidden;
|
1211
|
+
text-overflow: ellipsis;
|
1171
1212
|
}
|
1172
1213
|
.pro-header .pro-header-describe li.pro-header-only-tag {
|
1173
1214
|
margin-left: var(--zaui-space-size-sm, 8px);
|
@@ -1175,9 +1216,6 @@
|
|
1175
1216
|
.pro-header .pro-header-describe li.pro-header-only-tag span:first-child {
|
1176
1217
|
margin-right: 0;
|
1177
1218
|
}
|
1178
|
-
.pro-header .pro-header-describe li:first-child {
|
1179
|
-
margin-left: 0;
|
1180
|
-
}
|
1181
1219
|
.pro-header .pro-header-describe li span {
|
1182
1220
|
color: #0a0a0a;
|
1183
1221
|
font-weight: 400;
|
@@ -1192,6 +1230,12 @@
|
|
1192
1230
|
.pro-header .pro-header-describe li span:last-child .pro-header-tag {
|
1193
1231
|
margin-left: 4px;
|
1194
1232
|
}
|
1233
|
+
.pro-header-describe-items-tip {
|
1234
|
+
max-width: 600px;
|
1235
|
+
}
|
1236
|
+
.pro-header-describe-items-tip .pro-header-describe-items-tip-value {
|
1237
|
+
margin-bottom: var(--zaui-space-size-sm, 8px);
|
1238
|
+
}
|
1195
1239
|
@media (max-width: 1366px) {
|
1196
1240
|
.pro-header-describe li span:last-child {
|
1197
1241
|
max-width: 350px;
|
@@ -1253,7 +1297,7 @@
|
|
1253
1297
|
border-radius: 0 0 var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px);
|
1254
1298
|
}
|
1255
1299
|
.pro-layout.pro-layout-light .pro-header.pro-header-no-describe {
|
1256
|
-
padding: var(--zaui-space-size-md, 16px) !important;
|
1300
|
+
padding: 10px var(--zaui-space-size-md, 16px) !important;
|
1257
1301
|
}
|
1258
1302
|
.pro-layout.pro-layout-light .pro-header.pro-header-no-describe .pro-header-top {
|
1259
1303
|
padding-bottom: 0;
|
package/dist/less.esm.css
CHANGED
@@ -854,7 +854,7 @@
|
|
854
854
|
background: var(--zaui-disabled-bg);
|
855
855
|
}
|
856
856
|
.pro-header {
|
857
|
-
padding:
|
857
|
+
padding: 10px 0 0 0 !important;
|
858
858
|
background-color: var(--zaui-base-bg, #ffffff);
|
859
859
|
-webkit-box-shadow: 2px 3px 8px 0px rgba(0, 55, 93, 0.1);
|
860
860
|
box-shadow: 2px 3px 8px 0px rgba(0, 55, 93, 0.1);
|
@@ -881,9 +881,44 @@
|
|
881
881
|
.pro-header.pro-header-fixed.pro-header-no-describe .pro-header-top {
|
882
882
|
padding-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1) - var(--zaui-space-size-xs, 4px) * var(--zaui-size, 1));
|
883
883
|
}
|
884
|
+
.pro-header .pro-header-describe {
|
885
|
+
-webkit-transition: height 0.2s ease-in-out;
|
886
|
+
transition: height 0.2s ease-in-out;
|
887
|
+
}
|
884
888
|
.pro-header .pro-header-describe a {
|
885
889
|
color: var(--zaui-link, #006aff);
|
886
890
|
}
|
891
|
+
.pro-header .pro-header-describe .pro-header-describe-items-calc {
|
892
|
+
position: relative;
|
893
|
+
}
|
894
|
+
.pro-header .pro-header-describe.pro-header-describe-hidden {
|
895
|
+
height: 0;
|
896
|
+
padding: 0;
|
897
|
+
overflow: hidden;
|
898
|
+
border: 0;
|
899
|
+
}
|
900
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-label {
|
901
|
+
font-weight: normal;
|
902
|
+
}
|
903
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value {
|
904
|
+
font-weight: 600;
|
905
|
+
}
|
906
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .ant-space-item {
|
907
|
+
font-weight: 600;
|
908
|
+
}
|
909
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .pro-header-describe-items span:first-child {
|
910
|
+
margin-right: 2px;
|
911
|
+
}
|
912
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .pro-header-describe-items .pro-header-describe-items-omit {
|
913
|
+
position: absolute;
|
914
|
+
right: 0;
|
915
|
+
background: #fff;
|
916
|
+
}
|
917
|
+
.pro-header .pro-header-describe .ant-space .pro-header-describe-value .pro-header-describe-items.pro-header-describe-items-more .pro-header-tag {
|
918
|
+
padding: 0;
|
919
|
+
background: #fff;
|
920
|
+
color: #333;
|
921
|
+
}
|
887
922
|
.pro-header .pro-header-copy {
|
888
923
|
display: -webkit-box;
|
889
924
|
display: -webkit-flex;
|
@@ -1167,7 +1202,13 @@
|
|
1167
1202
|
font-size: var(--zaui-font-size, 14px);
|
1168
1203
|
}
|
1169
1204
|
.pro-header .pro-header-describe li {
|
1170
|
-
|
1205
|
+
-webkit-box-flex: 0;
|
1206
|
+
-webkit-flex: 0 0 auto;
|
1207
|
+
-ms-flex: 0 0 auto;
|
1208
|
+
flex: 0 0 auto;
|
1209
|
+
white-space: nowrap;
|
1210
|
+
overflow: hidden;
|
1211
|
+
text-overflow: ellipsis;
|
1171
1212
|
}
|
1172
1213
|
.pro-header .pro-header-describe li.pro-header-only-tag {
|
1173
1214
|
margin-left: var(--zaui-space-size-sm, 8px);
|
@@ -1175,9 +1216,6 @@
|
|
1175
1216
|
.pro-header .pro-header-describe li.pro-header-only-tag span:first-child {
|
1176
1217
|
margin-right: 0;
|
1177
1218
|
}
|
1178
|
-
.pro-header .pro-header-describe li:first-child {
|
1179
|
-
margin-left: 0;
|
1180
|
-
}
|
1181
1219
|
.pro-header .pro-header-describe li span {
|
1182
1220
|
color: #0a0a0a;
|
1183
1221
|
font-weight: 400;
|
@@ -1192,6 +1230,12 @@
|
|
1192
1230
|
.pro-header .pro-header-describe li span:last-child .pro-header-tag {
|
1193
1231
|
margin-left: 4px;
|
1194
1232
|
}
|
1233
|
+
.pro-header-describe-items-tip {
|
1234
|
+
max-width: 600px;
|
1235
|
+
}
|
1236
|
+
.pro-header-describe-items-tip .pro-header-describe-items-tip-value {
|
1237
|
+
margin-bottom: var(--zaui-space-size-sm, 8px);
|
1238
|
+
}
|
1195
1239
|
@media (max-width: 1366px) {
|
1196
1240
|
.pro-header-describe li span:last-child {
|
1197
1241
|
max-width: 350px;
|
@@ -1253,7 +1297,7 @@
|
|
1253
1297
|
border-radius: 0 0 var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px);
|
1254
1298
|
}
|
1255
1299
|
.pro-layout.pro-layout-light .pro-header.pro-header-no-describe {
|
1256
|
-
padding: var(--zaui-space-size-md, 16px) !important;
|
1300
|
+
padding: 10px var(--zaui-space-size-md, 16px) !important;
|
1257
1301
|
}
|
1258
1302
|
.pro-layout.pro-layout-light .pro-header.pro-header-no-describe .pro-header-top {
|
1259
1303
|
padding-bottom: 0;
|
@@ -26,6 +26,14 @@ export interface DescribeColumnsProps {
|
|
26
26
|
show?: boolean;
|
27
27
|
link?: string;
|
28
28
|
tag?: string | React.ReactNode | (string | React.ReactNode)[];
|
29
|
+
width?: string | number;
|
30
|
+
/** 多值配置 */
|
31
|
+
items?: {
|
32
|
+
copyable?: boolean;
|
33
|
+
value: string | React.ReactNode;
|
34
|
+
link?: string;
|
35
|
+
tag?: string | React.ReactNode | (string | React.ReactNode)[];
|
36
|
+
}[];
|
29
37
|
}
|
30
38
|
export interface ProHeaderProps {
|
31
39
|
title?: string | React.ReactNode;
|
@@ -2,29 +2,30 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/modal/style";
|
3
3
|
import _Modal from "antd/es/modal";
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
5
|
-
import "antd/es/tooltip/style";
|
6
|
-
import _Tooltip from "antd/es/tooltip";
|
7
5
|
import "antd/es/breadcrumb/style";
|
8
6
|
import _Breadcrumb from "antd/es/breadcrumb";
|
9
7
|
import "antd/es/divider/style";
|
10
8
|
import _Divider from "antd/es/divider";
|
9
|
+
import "antd/es/tooltip/style";
|
10
|
+
import _Tooltip from "antd/es/tooltip";
|
11
11
|
import "antd/es/space/style";
|
12
12
|
import _Space from "antd/es/space";
|
13
13
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
15
15
|
/* eslint-disable react/no-array-index-key */
|
16
16
|
|
17
|
-
import { memo, useEffect, useState } from 'react';
|
17
|
+
import { memo, useEffect, useState, useRef } from 'react';
|
18
18
|
import { tools } from '@zat-design/utils';
|
19
19
|
import classnames from 'classnames';
|
20
20
|
import moment from 'moment';
|
21
|
-
import { useToggle } from 'ahooks';
|
21
|
+
import { useToggle, useSize } from 'ahooks';
|
22
22
|
import { isFunction, isEmpty, isNumber, isString } from 'lodash';
|
23
23
|
import { ReactSVG } from 'react-svg';
|
24
24
|
import foldSvg from '../../../assets/arrow.svg';
|
25
25
|
import { Copy, ProBackBtn } from './components';
|
26
26
|
import getEnumLabel from '../../../ProEnum/utils/getEnumLabel';
|
27
27
|
import locale from '../../../locale';
|
28
|
+
import { checkDescribeItemsHidden } from './utils';
|
28
29
|
var formatAmount = tools.formatAmount;
|
29
30
|
var ProHeader = function ProHeader(props) {
|
30
31
|
var _props$breadcrumbList = props.breadcrumbList,
|
@@ -64,6 +65,8 @@ var ProHeader = function ProHeader(props) {
|
|
64
65
|
_useToggle2 = _slicedToArray(_useToggle, 2),
|
65
66
|
fold = _useToggle2[0],
|
66
67
|
toggle = _useToggle2[1].toggle;
|
68
|
+
var ref = useRef(null);
|
69
|
+
var size = useSize(ref);
|
67
70
|
var _title = title;
|
68
71
|
// 面包屑配置数据源
|
69
72
|
var _breadcrumbColumns = breadcrumbColumns || breadcrumbList;
|
@@ -94,7 +97,11 @@ var ProHeader = function ProHeader(props) {
|
|
94
97
|
return null;
|
95
98
|
}
|
96
99
|
return _jsx("ul", {
|
97
|
-
className:
|
100
|
+
className: classnames({
|
101
|
+
'pro-header-describe': true,
|
102
|
+
'pro-header-describe-open': fold,
|
103
|
+
'pro-header-describe-hidden': !fold
|
104
|
+
}),
|
98
105
|
children: describeData.map(function (item, index) {
|
99
106
|
var value = item.value,
|
100
107
|
copyable = item.copyable,
|
@@ -102,20 +109,20 @@ var ProHeader = function ProHeader(props) {
|
|
102
109
|
show = _item$show === void 0 ? true : _item$show,
|
103
110
|
tag = item.tag,
|
104
111
|
label = item.label,
|
105
|
-
link = item.link
|
112
|
+
link = item.link,
|
113
|
+
_item$items = item.items,
|
114
|
+
items = _item$items === void 0 ? [] : _item$items,
|
115
|
+
width = item.width;
|
106
116
|
// show为false直接隐藏¸
|
107
117
|
if (show === false || !show) {
|
108
118
|
return null;
|
109
119
|
}
|
110
120
|
var onlyTag = tag && !label && !value;
|
111
|
-
var
|
112
|
-
|
113
|
-
});
|
114
|
-
var tagRender = function tagRender() {
|
115
|
-
if (Array.isArray(tag) && tag.length) {
|
121
|
+
var tagRender = function tagRender(parmas) {
|
122
|
+
if (Array.isArray(parmas === null || parmas === void 0 ? void 0 : parmas.tag) && (parmas === null || parmas === void 0 ? void 0 : parmas.tag.length)) {
|
116
123
|
return _jsx(_Space, {
|
117
124
|
size: 4,
|
118
|
-
children: tag.map(function (tagItem, index) {
|
125
|
+
children: parmas.tag.map(function (tagItem, index) {
|
119
126
|
return _jsx("div", {
|
120
127
|
className: "pro-header-tag",
|
121
128
|
children: tagItem
|
@@ -123,32 +130,91 @@ var ProHeader = function ProHeader(props) {
|
|
123
130
|
})
|
124
131
|
});
|
125
132
|
}
|
126
|
-
return tag ? _jsx("div", {
|
133
|
+
return (parmas === null || parmas === void 0 ? void 0 : parmas.tag) ? _jsx("div", {
|
127
134
|
className: "pro-header-tag",
|
128
|
-
children: tag
|
135
|
+
children: parmas === null || parmas === void 0 ? void 0 : parmas.tag
|
129
136
|
}) : null;
|
130
137
|
};
|
131
|
-
|
138
|
+
/** 单行渲染 */
|
139
|
+
var valueRender = function valueRender(parmas) {
|
132
140
|
return _jsxs(_Space, {
|
133
141
|
size: 4,
|
134
|
-
align: tag ? 'baseline' : 'center',
|
135
|
-
children: [link ? _jsx("a", {
|
136
|
-
href: link,
|
142
|
+
align: (parmas === null || parmas === void 0 ? void 0 : parmas.tag) ? 'baseline' : 'center',
|
143
|
+
children: [(parmas === null || parmas === void 0 ? void 0 : parmas.link) ? _jsx("a", {
|
144
|
+
href: parmas.link,
|
137
145
|
rel: "noopener noreferrer",
|
138
146
|
target: "_blank",
|
139
|
-
children: value
|
140
|
-
}) : value, copyable && isString(value) ? _jsx(Copy, {
|
141
|
-
text: value
|
142
|
-
}) : null, tagRender(
|
147
|
+
children: parmas === null || parmas === void 0 ? void 0 : parmas.value
|
148
|
+
}) : parmas === null || parmas === void 0 ? void 0 : parmas.value, (parmas === null || parmas === void 0 ? void 0 : parmas.copyable) && isString(parmas === null || parmas === void 0 ? void 0 : parmas.value) ? _jsx(Copy, {
|
149
|
+
text: parmas.value
|
150
|
+
}) : null, tagRender({
|
151
|
+
tag: parmas === null || parmas === void 0 ? void 0 : parmas.tag
|
152
|
+
})]
|
143
153
|
});
|
144
154
|
};
|
145
|
-
|
155
|
+
/** 多行渲染 */
|
156
|
+
var itemsRender = function itemsRender() {
|
157
|
+
// items配置是否超长,超长配置... + tip 提示
|
158
|
+
var itemsHidden = checkDescribeItemsHidden(ref === null || ref === void 0 ? void 0 : ref.current);
|
159
|
+
var result = _jsxs("div", {
|
160
|
+
ref: ref,
|
161
|
+
className: classnames({
|
162
|
+
'pro-header-describe-items': true,
|
163
|
+
'pro-header-describe-items-more': items.length >= 2
|
164
|
+
}),
|
165
|
+
children: [(items === null || items === void 0 ? void 0 : items.length) > 3 ? "\u5171".concat(items === null || items === void 0 ? void 0 : items.length, "\u4E2A\uFF0C") : null, items.map(function (item, index) {
|
166
|
+
return _jsxs("span", {
|
167
|
+
children: [valueRender(item), (items === null || items === void 0 ? void 0 : items.length) !== index + 1 ? ' 、' : null]
|
168
|
+
}, index);
|
169
|
+
}), itemsHidden ? _jsx("span", {
|
170
|
+
className: "pro-header-describe-items-omit",
|
171
|
+
children: "..."
|
172
|
+
}) : null]
|
173
|
+
});
|
174
|
+
if (itemsHidden) {
|
175
|
+
var tipResult = _jsx(_Fragment, {
|
176
|
+
children: items.map(function (item, index) {
|
177
|
+
return _jsx("p", {
|
178
|
+
className: "pro-header-describe-items-tip-value",
|
179
|
+
children: valueRender(item)
|
180
|
+
}, index);
|
181
|
+
})
|
182
|
+
});
|
183
|
+
return _jsx(_Tooltip, {
|
184
|
+
placement: "bottomLeft",
|
185
|
+
overlayClassName: "pro-header-describe-items-tip",
|
186
|
+
title: tipResult,
|
187
|
+
children: result
|
188
|
+
});
|
189
|
+
}
|
190
|
+
return result;
|
191
|
+
};
|
192
|
+
var tagCls = classnames({
|
193
|
+
'pro-header-only-tag': onlyTag,
|
194
|
+
'pro-header-describe-items-calc': isString(width) ? width.includes('calc') : false
|
195
|
+
});
|
196
|
+
return _jsx("li", {
|
146
197
|
className: tagCls,
|
147
|
-
|
148
|
-
|
149
|
-
}
|
150
|
-
|
151
|
-
|
198
|
+
style: {
|
199
|
+
width: width
|
200
|
+
},
|
201
|
+
children: _jsxs(_Space, {
|
202
|
+
size: 4,
|
203
|
+
children: [label ? _jsx("span", {
|
204
|
+
className: "pro-header-describe-label",
|
205
|
+
children: label
|
206
|
+
}) : null, _jsx("span", {
|
207
|
+
className: "pro-header-describe-value",
|
208
|
+
children: (items === null || items === void 0 ? void 0 : items.length) ? itemsRender() : _jsx("span", {
|
209
|
+
children: valueRender({
|
210
|
+
value: value,
|
211
|
+
copyable: copyable,
|
212
|
+
tag: tag,
|
213
|
+
link: link
|
214
|
+
})
|
215
|
+
})
|
216
|
+
})]
|
217
|
+
})
|
152
218
|
}, index);
|
153
219
|
})
|
154
220
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
@import '../components/ProBackBtn/style/index';
|
4
4
|
|
5
5
|
.pro-header {
|
6
|
-
padding:
|
6
|
+
padding: 10px 0 0 0 !important;
|
7
7
|
background-color: var(--zaui-base-bg, #ffffff);
|
8
8
|
box-shadow: 2px 3px 8px 0px rgba(0, 55, 93, 0.1);
|
9
9
|
|
@@ -46,9 +46,48 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
.pro-header-describe {
|
49
|
+
transition: height 0.2s ease-in-out;
|
49
50
|
a {
|
50
51
|
color: var(--zaui-link, #006aff);
|
51
52
|
}
|
53
|
+
.pro-header-describe-items-calc{
|
54
|
+
position: relative;
|
55
|
+
}
|
56
|
+
&.pro-header-describe-hidden {
|
57
|
+
height: 0;
|
58
|
+
padding: 0;
|
59
|
+
overflow: hidden;
|
60
|
+
border: 0;
|
61
|
+
}
|
62
|
+
.@{ant-prefix}-space {
|
63
|
+
.pro-header-describe-label {
|
64
|
+
font-weight: normal;
|
65
|
+
}
|
66
|
+
.pro-header-describe-value{
|
67
|
+
font-weight: 600;
|
68
|
+
.@{ant-prefix}-space-item{
|
69
|
+
font-weight: 600;
|
70
|
+
}
|
71
|
+
.pro-header-describe-items{
|
72
|
+
span:first-child{
|
73
|
+
margin-right: 2px;
|
74
|
+
}
|
75
|
+
.pro-header-describe-items-omit{
|
76
|
+
position: absolute;
|
77
|
+
right: 0;
|
78
|
+
background: #fff;
|
79
|
+
}
|
80
|
+
&.pro-header-describe-items-more{
|
81
|
+
.pro-header-tag{
|
82
|
+
padding: 0;
|
83
|
+
background: #fff;
|
84
|
+
color: #333 ;
|
85
|
+
}
|
86
|
+
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
52
91
|
}
|
53
92
|
|
54
93
|
.pro-header-copy {
|
@@ -334,8 +373,10 @@
|
|
334
373
|
font-size: var(--zaui-font-size, 14px);
|
335
374
|
|
336
375
|
li {
|
337
|
-
|
338
|
-
|
376
|
+
flex: 0 0 auto;
|
377
|
+
white-space: nowrap;
|
378
|
+
overflow: hidden;
|
379
|
+
text-overflow: ellipsis;
|
339
380
|
&.pro-header-only-tag {
|
340
381
|
margin-left: var(--zaui-space-size-sm, 8px);
|
341
382
|
|
@@ -344,9 +385,6 @@
|
|
344
385
|
}
|
345
386
|
}
|
346
387
|
|
347
|
-
&:first-child {
|
348
|
-
margin-left: 0;
|
349
|
-
}
|
350
388
|
|
351
389
|
span {
|
352
390
|
color: #0a0a0a;
|
@@ -369,6 +407,13 @@
|
|
369
407
|
}
|
370
408
|
}
|
371
409
|
|
410
|
+
.pro-header-describe-items-tip{
|
411
|
+
max-width: 600px;
|
412
|
+
.pro-header-describe-items-tip-value{
|
413
|
+
margin-bottom: var(--zaui-space-size-sm, 8px);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
372
417
|
@media (max-width: 1366px) {
|
373
418
|
.pro-header-describe {
|
374
419
|
li span:last-child {
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* 检查描述dom是否部分隐藏
|
3
|
+
* @param ele dom节点
|
4
|
+
*/
|
5
|
+
export var checkDescribeItemsHidden = function checkDescribeItemsHidden(ele) {
|
6
|
+
var childElement = ele;
|
7
|
+
if (!childElement) {
|
8
|
+
return false;
|
9
|
+
}
|
10
|
+
var element = childElement.parentNode.parentNode.parentNode.parentNode;
|
11
|
+
var itemsScrollWidth = element.scrollWidth;
|
12
|
+
var itemsClientWidth = element.clientWidth;
|
13
|
+
return itemsScrollWidth > itemsClientWidth;
|
14
|
+
};
|
@@ -26,6 +26,14 @@ export interface DescribeColumnsProps {
|
|
26
26
|
show?: boolean;
|
27
27
|
link?: string;
|
28
28
|
tag?: string | React.ReactNode | (string | React.ReactNode)[];
|
29
|
+
width?: string | number;
|
30
|
+
/** 多值配置 */
|
31
|
+
items?: {
|
32
|
+
copyable?: boolean;
|
33
|
+
value: string | React.ReactNode;
|
34
|
+
link?: string;
|
35
|
+
tag?: string | React.ReactNode | (string | React.ReactNode)[];
|
36
|
+
}[];
|
29
37
|
}
|
30
38
|
export interface ProHeaderProps {
|
31
39
|
title?: string | React.ReactNode;
|
@@ -21,6 +21,7 @@ var _arrow = _interopRequireDefault(require("../../../assets/arrow.svg"));
|
|
21
21
|
var _components = require("./components");
|
22
22
|
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
23
23
|
var _locale = _interopRequireDefault(require("../../../locale"));
|
24
|
+
var _utils2 = require("./utils");
|
24
25
|
/* eslint-disable react/no-array-index-key */
|
25
26
|
|
26
27
|
var formatAmount = _utils.tools.formatAmount;
|
@@ -62,6 +63,8 @@ var ProHeader = function ProHeader(props) {
|
|
62
63
|
_useToggle2 = (0, _slicedToArray2.default)(_useToggle, 2),
|
63
64
|
fold = _useToggle2[0],
|
64
65
|
toggle = _useToggle2[1].toggle;
|
66
|
+
var ref = (0, _react.useRef)(null);
|
67
|
+
var size = (0, _ahooks.useSize)(ref);
|
65
68
|
var _title = title;
|
66
69
|
// 面包屑配置数据源
|
67
70
|
var _breadcrumbColumns = breadcrumbColumns || breadcrumbList;
|
@@ -92,7 +95,11 @@ var ProHeader = function ProHeader(props) {
|
|
92
95
|
return null;
|
93
96
|
}
|
94
97
|
return (0, _jsxRuntime.jsx)("ul", {
|
95
|
-
className:
|
98
|
+
className: (0, _classnames2.default)({
|
99
|
+
'pro-header-describe': true,
|
100
|
+
'pro-header-describe-open': fold,
|
101
|
+
'pro-header-describe-hidden': !fold
|
102
|
+
}),
|
96
103
|
children: describeData.map(function (item, index) {
|
97
104
|
var value = item.value,
|
98
105
|
copyable = item.copyable,
|
@@ -100,20 +107,20 @@ var ProHeader = function ProHeader(props) {
|
|
100
107
|
show = _item$show === void 0 ? true : _item$show,
|
101
108
|
tag = item.tag,
|
102
109
|
label = item.label,
|
103
|
-
link = item.link
|
110
|
+
link = item.link,
|
111
|
+
_item$items = item.items,
|
112
|
+
items = _item$items === void 0 ? [] : _item$items,
|
113
|
+
width = item.width;
|
104
114
|
// show为false直接隐藏¸
|
105
115
|
if (show === false || !show) {
|
106
116
|
return null;
|
107
117
|
}
|
108
118
|
var onlyTag = tag && !label && !value;
|
109
|
-
var
|
110
|
-
|
111
|
-
});
|
112
|
-
var tagRender = function tagRender() {
|
113
|
-
if (Array.isArray(tag) && tag.length) {
|
119
|
+
var tagRender = function tagRender(parmas) {
|
120
|
+
if (Array.isArray(parmas === null || parmas === void 0 ? void 0 : parmas.tag) && (parmas === null || parmas === void 0 ? void 0 : parmas.tag.length)) {
|
114
121
|
return (0, _jsxRuntime.jsx)(_antd.Space, {
|
115
122
|
size: 4,
|
116
|
-
children: tag.map(function (tagItem, index) {
|
123
|
+
children: parmas.tag.map(function (tagItem, index) {
|
117
124
|
return (0, _jsxRuntime.jsx)("div", {
|
118
125
|
className: "pro-header-tag",
|
119
126
|
children: tagItem
|
@@ -121,32 +128,91 @@ var ProHeader = function ProHeader(props) {
|
|
121
128
|
})
|
122
129
|
});
|
123
130
|
}
|
124
|
-
return tag ? (0, _jsxRuntime.jsx)("div", {
|
131
|
+
return (parmas === null || parmas === void 0 ? void 0 : parmas.tag) ? (0, _jsxRuntime.jsx)("div", {
|
125
132
|
className: "pro-header-tag",
|
126
|
-
children: tag
|
133
|
+
children: parmas === null || parmas === void 0 ? void 0 : parmas.tag
|
127
134
|
}) : null;
|
128
135
|
};
|
129
|
-
|
136
|
+
/** 单行渲染 */
|
137
|
+
var valueRender = function valueRender(parmas) {
|
130
138
|
return (0, _jsxRuntime.jsxs)(_antd.Space, {
|
131
139
|
size: 4,
|
132
|
-
align: tag ? 'baseline' : 'center',
|
133
|
-
children: [link ? (0, _jsxRuntime.jsx)("a", {
|
134
|
-
href: link,
|
140
|
+
align: (parmas === null || parmas === void 0 ? void 0 : parmas.tag) ? 'baseline' : 'center',
|
141
|
+
children: [(parmas === null || parmas === void 0 ? void 0 : parmas.link) ? (0, _jsxRuntime.jsx)("a", {
|
142
|
+
href: parmas.link,
|
135
143
|
rel: "noopener noreferrer",
|
136
144
|
target: "_blank",
|
137
|
-
children: value
|
138
|
-
}) : value, copyable && (0, _lodash.isString)(value) ? (0, _jsxRuntime.jsx)(_components.Copy, {
|
139
|
-
text: value
|
140
|
-
}) : null, tagRender(
|
145
|
+
children: parmas === null || parmas === void 0 ? void 0 : parmas.value
|
146
|
+
}) : parmas === null || parmas === void 0 ? void 0 : parmas.value, (parmas === null || parmas === void 0 ? void 0 : parmas.copyable) && (0, _lodash.isString)(parmas === null || parmas === void 0 ? void 0 : parmas.value) ? (0, _jsxRuntime.jsx)(_components.Copy, {
|
147
|
+
text: parmas.value
|
148
|
+
}) : null, tagRender({
|
149
|
+
tag: parmas === null || parmas === void 0 ? void 0 : parmas.tag
|
150
|
+
})]
|
151
|
+
});
|
152
|
+
};
|
153
|
+
/** 多行渲染 */
|
154
|
+
var itemsRender = function itemsRender() {
|
155
|
+
// items配置是否超长,超长配置... + tip 提示
|
156
|
+
var itemsHidden = (0, _utils2.checkDescribeItemsHidden)(ref === null || ref === void 0 ? void 0 : ref.current);
|
157
|
+
var result = (0, _jsxRuntime.jsxs)("div", {
|
158
|
+
ref: ref,
|
159
|
+
className: (0, _classnames2.default)({
|
160
|
+
'pro-header-describe-items': true,
|
161
|
+
'pro-header-describe-items-more': items.length >= 2
|
162
|
+
}),
|
163
|
+
children: [(items === null || items === void 0 ? void 0 : items.length) > 3 ? "\u5171".concat(items === null || items === void 0 ? void 0 : items.length, "\u4E2A\uFF0C") : null, items.map(function (item, index) {
|
164
|
+
return (0, _jsxRuntime.jsxs)("span", {
|
165
|
+
children: [valueRender(item), (items === null || items === void 0 ? void 0 : items.length) !== index + 1 ? ' 、' : null]
|
166
|
+
}, index);
|
167
|
+
}), itemsHidden ? (0, _jsxRuntime.jsx)("span", {
|
168
|
+
className: "pro-header-describe-items-omit",
|
169
|
+
children: "..."
|
170
|
+
}) : null]
|
141
171
|
});
|
172
|
+
if (itemsHidden) {
|
173
|
+
var tipResult = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
174
|
+
children: items.map(function (item, index) {
|
175
|
+
return (0, _jsxRuntime.jsx)("p", {
|
176
|
+
className: "pro-header-describe-items-tip-value",
|
177
|
+
children: valueRender(item)
|
178
|
+
}, index);
|
179
|
+
})
|
180
|
+
});
|
181
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
182
|
+
placement: "bottomLeft",
|
183
|
+
overlayClassName: "pro-header-describe-items-tip",
|
184
|
+
title: tipResult,
|
185
|
+
children: result
|
186
|
+
});
|
187
|
+
}
|
188
|
+
return result;
|
142
189
|
};
|
143
|
-
|
190
|
+
var tagCls = (0, _classnames2.default)({
|
191
|
+
'pro-header-only-tag': onlyTag,
|
192
|
+
'pro-header-describe-items-calc': (0, _lodash.isString)(width) ? width.includes('calc') : false
|
193
|
+
});
|
194
|
+
return (0, _jsxRuntime.jsx)("li", {
|
144
195
|
className: tagCls,
|
145
|
-
|
146
|
-
|
147
|
-
}
|
148
|
-
|
149
|
-
|
196
|
+
style: {
|
197
|
+
width: width
|
198
|
+
},
|
199
|
+
children: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
200
|
+
size: 4,
|
201
|
+
children: [label ? (0, _jsxRuntime.jsx)("span", {
|
202
|
+
className: "pro-header-describe-label",
|
203
|
+
children: label
|
204
|
+
}) : null, (0, _jsxRuntime.jsx)("span", {
|
205
|
+
className: "pro-header-describe-value",
|
206
|
+
children: (items === null || items === void 0 ? void 0 : items.length) ? itemsRender() : (0, _jsxRuntime.jsx)("span", {
|
207
|
+
children: valueRender({
|
208
|
+
value: value,
|
209
|
+
copyable: copyable,
|
210
|
+
tag: tag,
|
211
|
+
link: link
|
212
|
+
})
|
213
|
+
})
|
214
|
+
})]
|
215
|
+
})
|
150
216
|
}, index);
|
151
217
|
})
|
152
218
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
@import '../components/ProBackBtn/style/index';
|
4
4
|
|
5
5
|
.pro-header {
|
6
|
-
padding:
|
6
|
+
padding: 10px 0 0 0 !important;
|
7
7
|
background-color: var(--zaui-base-bg, #ffffff);
|
8
8
|
box-shadow: 2px 3px 8px 0px rgba(0, 55, 93, 0.1);
|
9
9
|
|
@@ -46,9 +46,48 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
.pro-header-describe {
|
49
|
+
transition: height 0.2s ease-in-out;
|
49
50
|
a {
|
50
51
|
color: var(--zaui-link, #006aff);
|
51
52
|
}
|
53
|
+
.pro-header-describe-items-calc{
|
54
|
+
position: relative;
|
55
|
+
}
|
56
|
+
&.pro-header-describe-hidden {
|
57
|
+
height: 0;
|
58
|
+
padding: 0;
|
59
|
+
overflow: hidden;
|
60
|
+
border: 0;
|
61
|
+
}
|
62
|
+
.@{ant-prefix}-space {
|
63
|
+
.pro-header-describe-label {
|
64
|
+
font-weight: normal;
|
65
|
+
}
|
66
|
+
.pro-header-describe-value{
|
67
|
+
font-weight: 600;
|
68
|
+
.@{ant-prefix}-space-item{
|
69
|
+
font-weight: 600;
|
70
|
+
}
|
71
|
+
.pro-header-describe-items{
|
72
|
+
span:first-child{
|
73
|
+
margin-right: 2px;
|
74
|
+
}
|
75
|
+
.pro-header-describe-items-omit{
|
76
|
+
position: absolute;
|
77
|
+
right: 0;
|
78
|
+
background: #fff;
|
79
|
+
}
|
80
|
+
&.pro-header-describe-items-more{
|
81
|
+
.pro-header-tag{
|
82
|
+
padding: 0;
|
83
|
+
background: #fff;
|
84
|
+
color: #333 ;
|
85
|
+
}
|
86
|
+
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
52
91
|
}
|
53
92
|
|
54
93
|
.pro-header-copy {
|
@@ -334,8 +373,10 @@
|
|
334
373
|
font-size: var(--zaui-font-size, 14px);
|
335
374
|
|
336
375
|
li {
|
337
|
-
|
338
|
-
|
376
|
+
flex: 0 0 auto;
|
377
|
+
white-space: nowrap;
|
378
|
+
overflow: hidden;
|
379
|
+
text-overflow: ellipsis;
|
339
380
|
&.pro-header-only-tag {
|
340
381
|
margin-left: var(--zaui-space-size-sm, 8px);
|
341
382
|
|
@@ -344,9 +385,6 @@
|
|
344
385
|
}
|
345
386
|
}
|
346
387
|
|
347
|
-
&:first-child {
|
348
|
-
margin-left: 0;
|
349
|
-
}
|
350
388
|
|
351
389
|
span {
|
352
390
|
color: #0a0a0a;
|
@@ -369,6 +407,13 @@
|
|
369
407
|
}
|
370
408
|
}
|
371
409
|
|
410
|
+
.pro-header-describe-items-tip{
|
411
|
+
max-width: 600px;
|
412
|
+
.pro-header-describe-items-tip-value{
|
413
|
+
margin-bottom: var(--zaui-space-size-sm, 8px);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
372
417
|
@media (max-width: 1366px) {
|
373
418
|
.pro-header-describe {
|
374
419
|
li span:last-child {
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.checkDescribeItemsHidden = void 0;
|
7
|
+
/**
|
8
|
+
* 检查描述dom是否部分隐藏
|
9
|
+
* @param ele dom节点
|
10
|
+
*/
|
11
|
+
var checkDescribeItemsHidden = exports.checkDescribeItemsHidden = function checkDescribeItemsHidden(ele) {
|
12
|
+
var childElement = ele;
|
13
|
+
if (!childElement) {
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
var element = childElement.parentNode.parentNode.parentNode.parentNode;
|
17
|
+
var itemsScrollWidth = element.scrollWidth;
|
18
|
+
var itemsClientWidth = element.clientWidth;
|
19
|
+
return itemsScrollWidth > itemsClientWidth;
|
20
|
+
};
|
package/package.json
CHANGED