@cqsjjb/jjb-react-admin-component 3.1.3 → 3.2.0-beta.0
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/BMap/index.d.ts +40 -0
- package/BMap/index.js +185 -0
- package/BMap/index.less +36 -0
- package/ControlWrapper/index.d.ts +45 -59
- package/ControlWrapper/index.js +70 -245
- package/Editor/index.js +330 -0
- package/Editor/index.ts +57 -0
- package/ErrorBoundary/index.d.ts +3 -6
- package/ErrorBoundary/index.js +3 -9
- package/FileUploader/index.d.ts +56 -0
- package/FileUploader/index.js +385 -0
- package/FileUploader/index.less +198 -0
- package/FormilyDescriptions/index.d.ts +116 -59
- package/FormilyDescriptions/index.js +202 -213
- package/FormilyRenderer/index.d.ts +15 -32
- package/FormilyRenderer/index.js +45 -25
- package/ImageCropper/index.d.ts +55 -0
- package/ImageCropper/index.js +131 -0
- package/ImageUploader/index.d.ts +79 -0
- package/ImageUploader/index.js +362 -0
- package/ImageUploader/index.less +100 -0
- package/MediaQuery/index.d.ts +9 -6
- package/MediaQuery/index.js +32 -81
- package/PageLayout/index.d.ts +44 -0
- package/PageLayout/index.js +85 -0
- package/PageLayout/index.less +47 -0
- package/SearchForm/index.d.ts +26 -49
- package/SearchForm/index.js +93 -108
- package/Table/index.d.ts +2 -6
- package/Table/index.js +1 -1
- package/TableAction/index.d.ts +15 -10
- package/TableAction/index.js +23 -15
- package/package.json +3 -3
- package/tools/index.d.ts +10 -0
- package/tools/index.js +87 -0
- package/SearchForm/index.less +0 -0
- package/Upload/index.d.ts +0 -76
- package/Upload/index.js +0 -334
- package/types/index.ts +0 -7
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@com-prefix-cls: if(isdefined(@ant-prefix), @ant-prefix, ant);
|
|
2
|
+
|
|
3
|
+
.@{com-prefix-cls}-upload {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
color: #000000d9;
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
font-variant: tabular-nums;
|
|
10
|
+
line-height: 1.5715;
|
|
11
|
+
list-style: none;
|
|
12
|
+
font-feature-settings: "tnum";
|
|
13
|
+
outline: 0
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.@{com-prefix-cls}-upload p {
|
|
17
|
+
margin: 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.@{com-prefix-cls}-upload-btn {
|
|
21
|
+
display: block;
|
|
22
|
+
width: 100%;
|
|
23
|
+
outline: none
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.@{com-prefix-cls}-upload input[type=file] {
|
|
27
|
+
cursor: pointer
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.@{com-prefix-cls}-upload.@{com-prefix-cls}-upload-select {
|
|
31
|
+
display: inline-block
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.@{com-prefix-cls}-upload.@{com-prefix-cls}-upload-disabled {
|
|
35
|
+
color: #00000040;
|
|
36
|
+
cursor: not-allowed
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.@{com-prefix-cls}-upload-list {
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 0;
|
|
43
|
+
color: #000000d9;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
font-variant: tabular-nums;
|
|
46
|
+
list-style: none;
|
|
47
|
+
font-feature-settings: "tnum";
|
|
48
|
+
line-height: 1.5715
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.@{com-prefix-cls}-upload-list:before {
|
|
52
|
+
display: table;
|
|
53
|
+
content: ""
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.@{com-prefix-cls}-upload-list:after {
|
|
57
|
+
display: table;
|
|
58
|
+
clear: both;
|
|
59
|
+
content: ""
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.@{com-prefix-cls}-upload-list-item {
|
|
63
|
+
position: relative;
|
|
64
|
+
height: 22.001px;
|
|
65
|
+
margin-top: 8px;
|
|
66
|
+
font-size: 14px
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.@{com-prefix-cls}-upload-list-item-name {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
width: 100%;
|
|
72
|
+
padding-left: 22px;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
line-height: 1.5715;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
text-overflow: ellipsis
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// TODO
|
|
81
|
+
.@{com-prefix-cls}-upload-list-text-container {
|
|
82
|
+
transition: opacity .3s,height .3s
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.@{com-prefix-cls}-upload-list-text-container:before {
|
|
86
|
+
display: table;
|
|
87
|
+
width: 0;
|
|
88
|
+
height: 0;
|
|
89
|
+
content: ""
|
|
90
|
+
}
|
|
91
|
+
// TODO
|
|
92
|
+
.@{com-prefix-cls}-upload-list-text-container .@{com-prefix-cls}-upload-span {
|
|
93
|
+
display: flex;
|
|
94
|
+
flex: auto
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.@{com-prefix-cls}-upload-list-text .@{com-prefix-cls}-upload-span {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.@{com-prefix-cls}-upload-list-text .@{com-prefix-cls}-upload-span>* {
|
|
103
|
+
flex: none
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.@{com-prefix-cls}-upload-list-text .@{com-prefix-cls}-upload-list-item-name {
|
|
107
|
+
flex: auto;
|
|
108
|
+
margin: 0;
|
|
109
|
+
padding: 0 8px
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// TODO
|
|
113
|
+
.@{com-prefix-cls}-upload-list-text .@{com-prefix-cls}-upload-list-item-card-actions,.@{com-prefix-cls}-upload-list-text .@{com-prefix-cls}-upload-text-icon .@{com-prefix-cls}icon {
|
|
114
|
+
position: static;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.@{com-prefix-cls}-upload-list .@{com-prefix-cls}-upload-animate-inline-appear,.@{com-prefix-cls}-upload-list .@{com-prefix-cls}-upload-animate-inline-enter,.@{com-prefix-cls}-upload-list .@{com-prefix-cls}-upload-animate-inline-leave {
|
|
118
|
+
animation-duration: .3s;
|
|
119
|
+
animation-timing-function: cubic-bezier(.78,.14,.15,.86);
|
|
120
|
+
animation-fill-mode: forwards
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.@{com-prefix-cls}-upload-list .@{com-prefix-cls}-upload-animate-inline-appear,.@{com-prefix-cls}-upload-list .@{com-prefix-cls}-upload-animate-inline-enter {
|
|
124
|
+
animation-name: uploadAnimateInlineIn
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.@{com-prefix-cls}-upload-list .@{com-prefix-cls}-upload-animate-inline-leave {
|
|
128
|
+
animation-name: uploadAnimateInlineOut
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes uploadAnimateInlineIn {
|
|
132
|
+
0% {
|
|
133
|
+
width: 0;
|
|
134
|
+
height: 0;
|
|
135
|
+
margin: 0;
|
|
136
|
+
padding: 0;
|
|
137
|
+
opacity: 0
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@keyframes uploadAnimateInlineOut {
|
|
142
|
+
to {
|
|
143
|
+
width: 0;
|
|
144
|
+
height: 0;
|
|
145
|
+
margin: 0;
|
|
146
|
+
padding: 0;
|
|
147
|
+
opacity: 0
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.@{com-prefix-cls}-upload-rtl {
|
|
152
|
+
direction: rtl
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.@{com-prefix-cls}-upload-list-rtl {
|
|
156
|
+
direction: rtl
|
|
157
|
+
}
|
|
158
|
+
// TODO
|
|
159
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-list-type-text:hover .@{com-prefix-cls}-upload-list-item-name-icon-count-1 {
|
|
160
|
+
padding-right: 22px;
|
|
161
|
+
padding-left: 14px
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-list-type-text:hover .@{com-prefix-cls}-upload-list-item-name-icon-count-2 {
|
|
165
|
+
padding-right: 22px;
|
|
166
|
+
padding-left: 28px
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-name {
|
|
170
|
+
padding-right: 22px;
|
|
171
|
+
padding-left: 0
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// TODO
|
|
175
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-card-actions {
|
|
176
|
+
right: auto;
|
|
177
|
+
left: 0
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-card-actions .@{com-prefix-cls}icon {
|
|
181
|
+
padding-right: 0;
|
|
182
|
+
padding-left: 5px
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// TODO
|
|
186
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-info {
|
|
187
|
+
padding: 0 4px 0 12px
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-error .@{com-prefix-cls}-upload-list-item-card-actions .@{com-prefix-cls}icon {
|
|
191
|
+
padding-right: 0;
|
|
192
|
+
padding-left: 5px
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.@{com-prefix-cls}-upload-list-rtl .@{com-prefix-cls}-upload-list-item-progress {
|
|
196
|
+
padding-right: 26px;
|
|
197
|
+
padding-left: 0
|
|
198
|
+
}
|
|
@@ -1,69 +1,126 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { DescriptionsProps as AntdDescriptionsProps } from 'antd';
|
|
3
|
+
import { ColumnsType } from 'antd/es/table';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
export type FormilyValue = string | number | boolean | null | undefined | FormilyValue[] | Record<string, any>;
|
|
6
|
+
|
|
7
|
+
export type FormilySchema = {
|
|
8
|
+
// 字段编码
|
|
9
|
+
fieldCode: string;
|
|
10
|
+
// 字段数据类型
|
|
11
|
+
fieldDataTypeEnum: string
|
|
12
|
+
// 字段长度
|
|
13
|
+
fieldLength: number
|
|
14
|
+
// 字段排序
|
|
15
|
+
fieldSort: number
|
|
16
|
+
// 表单组件类型
|
|
17
|
+
formType: string
|
|
18
|
+
// 表单组件输出值格式类型枚举
|
|
19
|
+
fromComponentEnum: string
|
|
20
|
+
// 表单组件信息枚举
|
|
21
|
+
fromComponentInfoEnum: string
|
|
22
|
+
// 字段名称
|
|
23
|
+
name: string
|
|
24
|
+
// 是否必填
|
|
25
|
+
requiredEnum: "TRUE" | "FALSE"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export interface FormilyDescriptionsProps extends Omit<AntdDescriptionsProps, 'items'> {
|
|
29
|
+
// 表单配置 (注意不是原始配置config,而是后端转换后的配置)
|
|
30
|
+
schema: Array<FormilySchema>; // 更严格类型,支持 Formily schema
|
|
31
|
+
// 表单值对象
|
|
32
|
+
values?: Record<string, FormilyValue>; // 表单值对象
|
|
33
|
+
// 详情组件大小
|
|
34
|
+
size?: 'small' | 'middle' | 'default';
|
|
35
|
+
// 内部TreeSelect组件的最大标签数量
|
|
36
|
+
maxTagCount?: number;
|
|
37
|
+
// 自定义渲染文本
|
|
38
|
+
renderItemText?: (params: { text: any; name?: string }) => React.ReactNode;
|
|
39
|
+
// 内部图片宽度
|
|
29
40
|
imageWidth?: number;
|
|
30
|
-
|
|
31
|
-
* @description 图片高度
|
|
32
|
-
*/
|
|
41
|
+
// 内部图片高度
|
|
33
42
|
imageHeight?: number;
|
|
34
|
-
|
|
35
|
-
* @description 图片预览配置
|
|
36
|
-
* @see https://ant.design/components/image-cn#previewtype
|
|
37
|
-
*/
|
|
38
|
-
imagePreview?: boolean | {}
|
|
39
|
-
/**
|
|
40
|
-
* @description 是否显示冒号
|
|
41
|
-
* @see https://ant.design/components/descriptions-cn#descriptions
|
|
42
|
-
*/
|
|
43
|
-
colon?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* @description 显示布局
|
|
46
|
-
* @see https://ant.design/components/descriptions-cn#descriptions
|
|
47
|
-
*/
|
|
48
|
-
layout?: 'vertical' | 'horizontal';
|
|
49
|
-
/**
|
|
50
|
-
* @description 参考antd/description
|
|
51
|
-
* @see https://ant.design/components/descriptions-cn#descriptions
|
|
52
|
-
*/
|
|
53
|
-
labelStyle?: React.CSSProperties;
|
|
54
|
-
/**
|
|
55
|
-
* @description 参考antd/description
|
|
56
|
-
* @see https://ant.design/components/descriptions-cn#descriptions
|
|
57
|
-
*/
|
|
58
|
-
contentStyle?: React.CSSProperties;
|
|
59
|
-
/**
|
|
60
|
-
* @description 是否外部预览?
|
|
61
|
-
*/
|
|
43
|
+
// 附件预览是打开浏览器窗口,还是当前页面
|
|
62
44
|
extraFileLink?: boolean;
|
|
45
|
+
// 是否显示图片预览
|
|
46
|
+
imagePreview?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FormilyFieldData {
|
|
50
|
+
name: string;
|
|
51
|
+
value?: FormilyValue;
|
|
52
|
+
formType?: string;
|
|
53
|
+
tableColumns?: ColumnsType<any>;
|
|
54
|
+
children?: FormilyFieldData[];
|
|
55
|
+
fromComponentEnum?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface DescriptionsRenderProps extends FormilyDescriptionsProps {
|
|
59
|
+
dataSource: FormilyFieldData[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ItemRenderProps extends FormilyDescriptionsProps {
|
|
63
|
+
data: FormilyFieldData;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
interface
|
|
66
|
+
export interface RenderTextProps {
|
|
67
|
+
value: any;
|
|
68
|
+
name?: string;
|
|
69
|
+
maxTagCount?: number;
|
|
70
|
+
renderItemText?: (params: { text: any; name?: string }) => React.ReactNode;
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
|
|
73
|
+
export interface RenderFileItemProps {
|
|
74
|
+
url: string;
|
|
75
|
+
name: string;
|
|
76
|
+
isImage?: boolean;
|
|
77
|
+
imageWidth?: number;
|
|
78
|
+
imageHeight?: number;
|
|
79
|
+
imagePreview?: any;
|
|
80
|
+
extraFileLink?: boolean;
|
|
81
|
+
onPreview?: () => void;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface RenderImageProps {
|
|
85
|
+
url: string;
|
|
86
|
+
imageWidth?: number;
|
|
87
|
+
imageHeight?: number;
|
|
88
|
+
imagePreview?: any;
|
|
89
|
+
extraFileLink?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface RenderValidFileProps {
|
|
93
|
+
url: string;
|
|
94
|
+
name: string;
|
|
95
|
+
extraFileLink?: boolean;
|
|
96
|
+
onPreview?: () => void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface RenderInvalidFileProps {
|
|
100
|
+
url: string;
|
|
101
|
+
name: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface RenderTableProps {
|
|
105
|
+
columns: ColumnsType<any>;
|
|
106
|
+
dataSource: any[];
|
|
107
|
+
imageWidth?: number;
|
|
108
|
+
imageHeight?: number;
|
|
109
|
+
imagePreview?: any;
|
|
110
|
+
extraFileLink?: boolean;
|
|
111
|
+
onPreview?: (url: string) => void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// 命名导出
|
|
115
|
+
export declare function DescriptionsRender(props: DescriptionsRenderProps): JSX.Element[];
|
|
116
|
+
export declare function ItemRender(props: ItemRenderProps): JSX.Element;
|
|
117
|
+
export declare function RenderText(props: RenderTextProps): JSX.Element;
|
|
118
|
+
export declare function RenderFileItem(props: RenderFileItemProps): JSX.Element;
|
|
119
|
+
export declare function RenderImage(props: RenderImageProps): JSX.Element;
|
|
120
|
+
export declare function RenderValidFile(props: RenderValidFileProps): JSX.Element;
|
|
121
|
+
export declare function RenderInvalidFile(props: RenderInvalidFileProps): JSX.Element;
|
|
122
|
+
export declare function RenderTable(props: RenderTableProps): JSX.Element;
|
|
123
|
+
|
|
124
|
+
// 默认导出
|
|
125
|
+
declare const FormilyDescriptions: (props: FormilyDescriptionsProps) => JSX.Element;
|
|
69
126
|
export default FormilyDescriptions;
|