@zat-design/sisyphus-react 4.7.0-beta.2 → 4.7.1
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 +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProForm/components/combination/FormList/components/LineFields.js +1 -1
- package/es/ProForm/components/combination/FormList/style/index.less +5 -0
- package/es/ProForm/components/render/Render.js +11 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +184 -132
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +53 -14
- package/es/ProLayout/components/Layout/Menu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/index.js +2 -0
- package/es/ProLayout/components/Layout/Menu/style/index.less +6 -31
- package/es/ProLayout/index.js +3 -0
- package/es/ProLayout/propTypes.d.ts +5 -0
- package/es/ProLayout/style/index.less +24 -3
- package/es/ProLayout/style/variables.less +4 -0
- package/es/ProUpload/components/ButtonRender.js +4 -2
- package/es/ProUpload/components/DragRender.js +6 -3
- package/es/ProUpload/components/ImageRender.js +31 -24
- package/es/ProUpload/style/index.less +5 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.js +8 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import '../../style/variables.less';
|
|
2
|
+
@import './variables.less';
|
|
2
3
|
@import '../components/Layout/index.less';
|
|
3
4
|
@import '../components/ProCollapse/style/index.less';
|
|
4
5
|
@import '../components/ProFooter/style/index.less';
|
|
@@ -6,6 +7,12 @@
|
|
|
6
7
|
@import '../components/TabsManager/style/index.less';
|
|
7
8
|
|
|
8
9
|
.pro-layout {
|
|
10
|
+
--pro-layout-menu-fold-width: @pro-layout-menu-fold-width;
|
|
11
|
+
|
|
12
|
+
&.pro-layout-show-collapsed-menu-label {
|
|
13
|
+
--pro-layout-menu-fold-width: @pro-layout-menu-label-width;
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
display: flex;
|
|
10
17
|
flex-direction: column;
|
|
11
18
|
min-height: 100vh;
|
|
@@ -138,6 +145,10 @@
|
|
|
138
145
|
color: #fff;
|
|
139
146
|
}
|
|
140
147
|
|
|
148
|
+
h2 {
|
|
149
|
+
color: var(--zaui-base-bg, #ffffff);
|
|
150
|
+
}
|
|
151
|
+
|
|
141
152
|
&::before {
|
|
142
153
|
position: absolute;
|
|
143
154
|
top: 4px;
|
|
@@ -174,6 +185,16 @@
|
|
|
174
185
|
}
|
|
175
186
|
}
|
|
176
187
|
|
|
188
|
+
.pro-layout-menu-fold-show-label .pro-layout-menu-fold-list li {
|
|
189
|
+
&.active::before,
|
|
190
|
+
&:hover::before {
|
|
191
|
+
top: 0;
|
|
192
|
+
left: 8px;
|
|
193
|
+
width: calc(100% - 16px);
|
|
194
|
+
height: 56px;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
177
198
|
.pro-layout-menu-collapsed {
|
|
178
199
|
background: #f7f9fd;
|
|
179
200
|
border-right: none;
|
|
@@ -291,7 +312,7 @@
|
|
|
291
312
|
.pro-layout-tabs-bar-wrapper {
|
|
292
313
|
// 与 pro-layout-content 对齐:同样的左右边距,无内边距让 tab 从左侧直接对齐
|
|
293
314
|
margin-right: var(--zaui-space-size-md, 16px);
|
|
294
|
-
margin-left:
|
|
315
|
+
margin-left: @pro-layout-menu-fold-size;
|
|
295
316
|
padding: 0;
|
|
296
317
|
// 滚动时固定在 header 和 notice 正下方
|
|
297
318
|
position: sticky;
|
|
@@ -314,7 +335,7 @@
|
|
|
314
335
|
|
|
315
336
|
// 菜单展开时与内容区同步右移
|
|
316
337
|
&.tabs-menu-open {
|
|
317
|
-
margin-left:
|
|
338
|
+
margin-left: @pro-layout-menu-open-width;
|
|
318
339
|
}
|
|
319
340
|
|
|
320
341
|
// Tab 存在时展开
|
|
@@ -337,7 +358,7 @@
|
|
|
337
358
|
margin-top: 0;
|
|
338
359
|
margin-right: var(--zaui-space-size-md, 16px);
|
|
339
360
|
margin-bottom: 0;
|
|
340
|
-
margin-left:
|
|
361
|
+
margin-left: @pro-layout-menu-fold-size;
|
|
341
362
|
padding: 0 var(--zaui-space-size-md, 16px);
|
|
342
363
|
background: #ffffff;
|
|
343
364
|
border-top: 1px solid rgb(235 236 238);
|
|
@@ -5,6 +5,7 @@ import { SortableContext, rectSortingStrategy } from "@dnd-kit/sortable";
|
|
|
5
5
|
import { CloudUploadOutlined } from "@ant-design/icons";
|
|
6
6
|
import { FileItem } from "./FileItem";
|
|
7
7
|
import { DraggableUploadListItem } from "./DraggableUploadListItem";
|
|
8
|
+
import { isEmptyReactNode } from "../../utils";
|
|
8
9
|
import locale from "../../locale";
|
|
9
10
|
const ButtonRender = (props) => {
|
|
10
11
|
var _a, _b;
|
|
@@ -46,13 +47,14 @@ const ButtonRender = (props) => {
|
|
|
46
47
|
) });
|
|
47
48
|
}
|
|
48
49
|
};
|
|
50
|
+
const tipText = typeof extraTipText === "function" ? extraTipText() : extraTipText;
|
|
49
51
|
return /* @__PURE__ */ jsxs("div", { className: "pro-upload-button", children: [
|
|
50
52
|
/* @__PURE__ */ jsx(DndContext, { sensors: [sensor], onDragEnd, children: /* @__PURE__ */ jsx(SortableContext, { items: fileList.map((i) => i.uid), strategy: rectSortingStrategy, children: /* @__PURE__ */ jsx(Upload, { ...buttonUploadProps, children: !isView && /* @__PURE__ */ jsxs("div", { className: "pro-upload-button-inner", children: [
|
|
51
53
|
/* @__PURE__ */ jsxs(Button, { ...buttonProps, disabled: disabled || isView, children: [
|
|
52
54
|
/* @__PURE__ */ jsx(CloudUploadOutlined, {}),
|
|
53
55
|
buttonText
|
|
54
56
|
] }),
|
|
55
|
-
afterRender ? /* @__PURE__ */ jsx(
|
|
57
|
+
!isEmptyReactNode(afterRender) ? /* @__PURE__ */ jsx(
|
|
56
58
|
"div",
|
|
57
59
|
{
|
|
58
60
|
className: "pro-upload-button-inner-right",
|
|
@@ -61,7 +63,7 @@ const ButtonRender = (props) => {
|
|
|
61
63
|
}
|
|
62
64
|
) : null
|
|
63
65
|
] }) }) }) }),
|
|
64
|
-
|
|
66
|
+
!isEmptyReactNode(tipText) && /* @__PURE__ */ jsx("div", { className: "upload-tip-txt", children: tipText })
|
|
65
67
|
] });
|
|
66
68
|
};
|
|
67
69
|
var ButtonRender_default = ButtonRender;
|
|
@@ -6,6 +6,7 @@ import { SortableContext, rectSortingStrategy } from "@dnd-kit/sortable";
|
|
|
6
6
|
import { CloudUploadOutlined } from "@ant-design/icons";
|
|
7
7
|
import { DragSingleFileItem, FileItem, getFileExt, getFileIcon } from "./FileItem";
|
|
8
8
|
import { DraggableUploadListItem } from "./DraggableUploadListItem";
|
|
9
|
+
import { isEmptyReactNode } from "../../utils";
|
|
9
10
|
import locale from "../../locale";
|
|
10
11
|
const { Dragger } = Upload;
|
|
11
12
|
const DragRender = (props) => {
|
|
@@ -88,9 +89,11 @@ const DragRender = (props) => {
|
|
|
88
89
|
disabled,
|
|
89
90
|
openFileDialogOnClick: !showDraggerSingleRender
|
|
90
91
|
};
|
|
92
|
+
const header = headerRender();
|
|
93
|
+
const footer = footerRender();
|
|
91
94
|
return /* @__PURE__ */ jsxs("div", { className: "pro-upload-dragger", children: [
|
|
92
95
|
/* @__PURE__ */ jsxs("div", { className: "pro-upload-handle-box", children: [
|
|
93
|
-
/* @__PURE__ */ jsx("div", { className: "pro-upload-dragger-header", children:
|
|
96
|
+
!isEmptyReactNode(header) && /* @__PURE__ */ jsx("div", { className: "pro-upload-dragger-header", children: header }),
|
|
94
97
|
/* @__PURE__ */ jsx(Dragger, { ...dragUploadProps, children: /* @__PURE__ */ jsxs("div", { className: "drag-upload-inner", ref: refReSelect, children: [
|
|
95
98
|
!showDraggerSingleRender && /* @__PURE__ */ jsxs("div", { className: "upload-dragger-control", children: [
|
|
96
99
|
/* @__PURE__ */ jsxs("div", { className: "dragger-txt-line1", children: [
|
|
@@ -108,11 +111,11 @@ const DragRender = (props) => {
|
|
|
108
111
|
":",
|
|
109
112
|
extExt.length > 0 ? extExt.join("、") : `${(_h = (_g = locale) == null ? void 0 : _g.ProUpload) == null ? void 0 : _h.draggerLimitless}`
|
|
110
113
|
] }),
|
|
111
|
-
customTextRender && /* @__PURE__ */ jsx("p", { className: "file-ext", children: customTextRender })
|
|
114
|
+
!isEmptyReactNode(customTextRender) && /* @__PURE__ */ jsx("p", { className: "file-ext", children: customTextRender })
|
|
112
115
|
] }),
|
|
113
116
|
/* @__PURE__ */ jsx("div", { className: "dragger-file-show", children: showDraggerSingleRender && draggerSingleRender(fileList[0]) })
|
|
114
117
|
] }) }),
|
|
115
|
-
/* @__PURE__ */ jsx("div", { className: "pro-upload-dragger-footer", children:
|
|
118
|
+
!isEmptyReactNode(footer) && /* @__PURE__ */ jsx("div", { className: "pro-upload-dragger-footer", children: footer })
|
|
116
119
|
] }),
|
|
117
120
|
/* @__PURE__ */ jsx("div", { className: "pro-upload-file-list", children: /* @__PURE__ */ jsx(DndContext, { sensors: [sensor], onDragEnd, children: /* @__PURE__ */ jsx(SortableContext, { items: fileList.map((i) => i.uid), strategy: rectSortingStrategy, children: maxCount > 1 && fileList.map((file) => {
|
|
118
121
|
return /* @__PURE__ */ jsx(DraggableUploadListItem, { file, children: /* @__PURE__ */ jsx(
|
|
@@ -9,6 +9,7 @@ import { PlusOutlined } from "@ant-design/icons";
|
|
|
9
9
|
import { Example } from "./Example";
|
|
10
10
|
import { getFileExt, getFileIcon } from "./FileItem";
|
|
11
11
|
import { DraggableUploadListItem } from "./DraggableUploadListItem";
|
|
12
|
+
import { isEmptyReactNode } from "../../utils";
|
|
12
13
|
import lookSvg from "../../assets/look.svg";
|
|
13
14
|
import deleteSvg from "../../assets/delete.svg";
|
|
14
15
|
import downloadSvg from "../../assets/download.svg";
|
|
@@ -149,31 +150,37 @@ const ImageRender = (props) => {
|
|
|
149
150
|
) });
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
153
|
+
const footer = footerRender();
|
|
154
|
+
const hasFooter = !isEmptyReactNode(footer);
|
|
155
|
+
const hasCenterRender = typeof centerRender === "function" || !isEmptyReactNode(centerRender);
|
|
156
|
+
const tipText = typeof extraTipText === "function" ? extraTipText() : extraTipText;
|
|
157
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
158
|
+
/* @__PURE__ */ jsxs(Space, { orientation: "vertical", size: 8, className: "pro-upload-image", children: [
|
|
159
|
+
headerRender(),
|
|
160
|
+
/* @__PURE__ */ jsxs("div", { className: "pro-upload-image", children: [
|
|
161
|
+
/* @__PURE__ */ jsx(DndContext, { sensors: [sensor], onDragEnd, children: /* @__PURE__ */ jsx(SortableContext, { items: fileList.map((i) => i.uid), strategy: rectSortingStrategy, children: /* @__PURE__ */ jsx(Upload, { ...imageUploadProps, children: fileList.length < maxCount && !isView && (hasCenterRender ? isFunction(centerRender) ? centerRender() : centerRender : /* @__PURE__ */ jsxs(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
className: `pro-upload-image-inner ${disabled ? "pro-upload-image-disabled" : ""} `,
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx(PlusOutlined, {}),
|
|
167
|
+
/* @__PURE__ */ jsx("div", { style: { marginTop: 8 }, children: (_b = (_a = locale) == null ? void 0 : _a.ProUpload) == null ? void 0 : _b.buttonText })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)) }) }) }),
|
|
171
|
+
showExampleContent && !isView && /* @__PURE__ */ jsx(
|
|
172
|
+
Example,
|
|
173
|
+
{
|
|
174
|
+
className: "image-example",
|
|
175
|
+
exampleTitle,
|
|
176
|
+
exampleContent,
|
|
177
|
+
exampleModalProps
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
!isEmptyReactNode(tipText) && /* @__PURE__ */ jsx("div", { className: "upload-tip-txt", children: tipText })
|
|
181
|
+
] }),
|
|
182
|
+
hasFooter && /* @__PURE__ */ jsx("div", { className: "pro-upload-image-footer", children: footer })
|
|
175
183
|
] }),
|
|
176
|
-
/* @__PURE__ */ jsx("div", { className: "pro-upload-image-footer", children: footerRender() }),
|
|
177
184
|
/* @__PURE__ */ jsx(
|
|
178
185
|
Modal,
|
|
179
186
|
{
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare const customEqualForFunction: (value: any, other: any) => boolean;
|
|
2
3
|
/**
|
|
3
4
|
* 兼容 React17/18 的 startTransition。
|
|
@@ -10,6 +11,8 @@ export declare function compatStartTransition(cb: () => void): void;
|
|
|
10
11
|
* 空值 或者 仅包含空值的数组视为空
|
|
11
12
|
*/
|
|
12
13
|
export declare const isEmpty: (value: any, emptyValue?: string) => boolean;
|
|
14
|
+
/** 判断 React 节点是否没有可渲染内容,保留数字 0 */
|
|
15
|
+
export declare const isEmptyReactNode: (value: React.ReactNode) => boolean;
|
|
13
16
|
/**
|
|
14
17
|
* 生成用于 UI 元素的随机短 ID(非安全用途)
|
|
15
18
|
*/
|
package/es/utils/index.js
CHANGED
|
@@ -32,6 +32,12 @@ const isEmpty = (value, emptyValue) => {
|
|
|
32
32
|
}
|
|
33
33
|
return false;
|
|
34
34
|
};
|
|
35
|
+
const isEmptyReactNode = (value) => {
|
|
36
|
+
if (Array.isArray(value)) {
|
|
37
|
+
return value.every(isEmptyReactNode);
|
|
38
|
+
}
|
|
39
|
+
return value === void 0 || value === null || typeof value === "boolean" || value === "";
|
|
40
|
+
};
|
|
35
41
|
const generateId = () => Math.random().toString(36).slice(-6);
|
|
36
42
|
const isEllipsisActive = (element) => {
|
|
37
43
|
if (!element)
|
|
@@ -47,5 +53,6 @@ export {
|
|
|
47
53
|
customEqualForFunction,
|
|
48
54
|
generateId,
|
|
49
55
|
isEllipsisActive,
|
|
50
|
-
isEmpty
|
|
56
|
+
isEmpty,
|
|
57
|
+
isEmptyReactNode
|
|
51
58
|
};
|