fat-design 0.0.2-beta.20251109210537 → 0.0.2-beta.20251115205053
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/index.browser.js +22 -22
- package/index.js +8998 -8507
- package/index.umd.cjs +21 -21
- package/index.umd.js +21 -21
- package/package.json +2 -2
- package/style.css +1 -1
- package/types/0buildTypes/previews/renderFileImage.d.ts +10 -2
- package/types/0buildTypes/util/string.d.ts +5 -0
- package/types/dialog/index.d.ts +88 -2
- package/types/upload/index.d.ts +29 -4
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import './renderFileImage.scss';
|
|
2
3
|
interface IRenderProps {
|
|
3
4
|
value: any;
|
|
4
5
|
prefix?: string;
|
|
6
|
+
isList?: boolean;
|
|
5
7
|
}
|
|
6
8
|
interface IRenderCfg {
|
|
7
9
|
deep: number;
|
|
8
10
|
index: number;
|
|
9
11
|
prefix: string;
|
|
12
|
+
isList?: boolean;
|
|
10
13
|
}
|
|
11
14
|
interface IRenderLinkFnProps extends IRenderCfg {
|
|
12
15
|
downloadURL: string;
|
|
@@ -15,9 +18,10 @@ interface IRenderLinkFnProps extends IRenderCfg {
|
|
|
15
18
|
name?: string;
|
|
16
19
|
}
|
|
17
20
|
type IRenderLinkFn = (props: IRenderLinkFnProps) => any;
|
|
21
|
+
declare function renderFileWebOffice(value: any, cfg: IRenderCfg): any;
|
|
18
22
|
declare function renderFileDownload(value: any, cfg: IRenderCfg): any;
|
|
19
23
|
declare function renderFileImage(value: any, cfg: IRenderCfg): any;
|
|
20
|
-
declare function renderFileAutoBySuffix(value: any, cfg: IRenderCfg):
|
|
24
|
+
declare function renderFileAutoBySuffix(value: any, cfg: IRenderCfg): React.JSX.Element;
|
|
21
25
|
declare const RenderFileDownload: React.MemoExoticComponent<{
|
|
22
26
|
(props: IRenderProps): any;
|
|
23
27
|
displayName: string;
|
|
@@ -30,5 +34,9 @@ declare const RenderFileAutoBySuffix: React.MemoExoticComponent<{
|
|
|
30
34
|
(props: IRenderProps): any;
|
|
31
35
|
displayName: string;
|
|
32
36
|
}>;
|
|
33
|
-
|
|
37
|
+
declare const RenderFileWebOffice: React.MemoExoticComponent<{
|
|
38
|
+
(props: IRenderProps): any;
|
|
39
|
+
displayName: string;
|
|
40
|
+
}>;
|
|
41
|
+
export { RenderFileImage, renderFileImage, renderFileDownload, RenderFileDownload, renderFileAutoBySuffix, RenderFileAutoBySuffix, renderFileWebOffice, RenderFileWebOffice, };
|
|
34
42
|
export type { IRenderProps, IRenderCfg, IRenderLinkFnProps, IRenderLinkFn };
|
package/types/dialog/index.d.ts
CHANGED
|
@@ -263,6 +263,83 @@ export interface IShowBatchInputCfg extends QuickShowConfig {
|
|
|
263
263
|
topTips?: any;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
|
|
267
|
+
export interface IShowImportFieldMapping {
|
|
268
|
+
source: string, // Excel字段名
|
|
269
|
+
target: string, // 映射成json的字段名
|
|
270
|
+
type: 'string'| 'date' | 'origin', // 数据类型
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
export interface IBatchProcessElementResultList {
|
|
275
|
+
element: any;
|
|
276
|
+
index: number;
|
|
277
|
+
result?: any;
|
|
278
|
+
errorMsg?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// onBatchProcessDone({errorCount, successCount, elementResultList }
|
|
282
|
+
|
|
283
|
+
export interface ITypeOnBatchProcessDoneParam {
|
|
284
|
+
errorCount?: number;
|
|
285
|
+
successCount?: number;
|
|
286
|
+
elementResultList: IBatchProcessElementResultList[]
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface IHandleProcessElementResult {
|
|
290
|
+
success: boolean;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* 函数:批量导入完成事件
|
|
295
|
+
*/
|
|
296
|
+
export type TypeOnBatchProcessDone = (param: ITypeOnBatchProcessDoneParam)=> Promise<void>;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* 函数:执行单个导入
|
|
300
|
+
*/
|
|
301
|
+
export type TypeHandleProcessElement = (elementObj: any)=> Promise<IHandleProcessElementResult>;
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Excel导入对话框的配置
|
|
306
|
+
*/
|
|
307
|
+
export interface IShowBatchByExcelCfg extends QuickShowConfig {
|
|
308
|
+
excelTemplateName: string, //字符串:excel导入模板的模板名称。 不能为空
|
|
309
|
+
excelTemplateUrl: string, //字符串:excel导入模板的模板的下载地址URL。 不能为空
|
|
310
|
+
fieldMappingList: IShowImportFieldMapping[], // 字段映射:表格中的表头和我们需要的结构化字段的映射关系
|
|
311
|
+
|
|
312
|
+
loadExcelScript: ()=> Promise<void>, //函数:加载window.XLSX使用的脚本文件, 不能为空
|
|
313
|
+
preprocessTableData: (tableData: any[])=> Promise<void>, //函数:导入前校验数据完整性,也可以对数据设置一些字段
|
|
314
|
+
|
|
315
|
+
onBatchProcessDone?: TypeOnBatchProcessDone, // 函数:批量处理完成事件
|
|
316
|
+
handleProcessElement: TypeHandleProcessElement, // 函数:执行单个数据处理
|
|
317
|
+
notifyOnError?: boolean, // 出现错误时,是否使用Notification.error直接显示出来。默认为false
|
|
318
|
+
elementDisplayKey?: string, // 出现错误时,用于标识某一条数据的key
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* 批处理的一些文案
|
|
323
|
+
*/
|
|
324
|
+
export interface IShowBatchProcessMsgCfg {
|
|
325
|
+
confirmMsg?: string; // 确认提示文案。
|
|
326
|
+
processMsg?: string; // 处理中的提示文案
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* 批量数据数对话框的配置
|
|
331
|
+
*/
|
|
332
|
+
export interface IShowBatchProcessCfg extends QuickShowConfig {
|
|
333
|
+
elementList: any[], // 需要被处理的元素列表
|
|
334
|
+
msgCfg?: IShowBatchProcessMsgCfg,
|
|
335
|
+
|
|
336
|
+
onBatchProcessDone?: TypeOnBatchProcessDone, // 函数:批量导入完成事件
|
|
337
|
+
handleProcessElement: TypeHandleProcessElement, // 函数:执行单个导入
|
|
338
|
+
notifyOnError?: boolean, // 出现错误时,是否使用Notification.error直接显示出来。默认为false
|
|
339
|
+
elementDisplayKey?: string, // 出现错误时,用于标识某一条数据的key
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
|
|
266
343
|
export interface IShowCompCfg extends QuickShowConfig {
|
|
267
344
|
component: any,
|
|
268
345
|
xProps: any,
|
|
@@ -277,7 +354,7 @@ export interface TypeShowFormCfgOnOKParams {
|
|
|
277
354
|
export type TypeShowFormCfgOnOK = (p: TypeShowFormCfgOnOKParams, ...args: any) => any;
|
|
278
355
|
|
|
279
356
|
export interface IShowFormCfg extends QuickShowConfig {
|
|
280
|
-
formProps
|
|
357
|
+
formProps?: FormProps;
|
|
281
358
|
bottomTips?: any;
|
|
282
359
|
topTips?: any;
|
|
283
360
|
validate?: boolean;
|
|
@@ -292,6 +369,11 @@ export interface TypeShowInputCfgOnOKParams extends TypeShowFormCfgOnOKParams {
|
|
|
292
369
|
formInputValue: string
|
|
293
370
|
}
|
|
294
371
|
|
|
372
|
+
interface IEnumItem {
|
|
373
|
+
label: string;
|
|
374
|
+
value: any;
|
|
375
|
+
}
|
|
376
|
+
|
|
295
377
|
export type TypeShowInputCfgOnOK = (p:TypeShowInputCfgOnOKParams, ...args: any)=>any;
|
|
296
378
|
export type IShowInputCfgMode = 'textareaMode' | 'inputMode';
|
|
297
379
|
export interface IShowInputCfg extends IShowFormCfg {
|
|
@@ -305,7 +387,8 @@ export interface IShowInputCfg extends IShowFormCfg {
|
|
|
305
387
|
defaultValue?: string;
|
|
306
388
|
mode?: IShowInputCfgMode;
|
|
307
389
|
specialReg?: RegExp;
|
|
308
|
-
onOk?: TypeShowInputCfgOnOK
|
|
390
|
+
onOk?: TypeShowInputCfgOnOK,
|
|
391
|
+
enums? : IEnumItem[], // showAudit有用到
|
|
309
392
|
}
|
|
310
393
|
|
|
311
394
|
|
|
@@ -314,8 +397,11 @@ export default class Dialog extends React.Component<DialogProps, any> {
|
|
|
314
397
|
static showComp(config: IShowCompCfg): QuickShowRet;
|
|
315
398
|
static showForm(config: IShowFormCfg): QuickShowRet;
|
|
316
399
|
static showInput(config: IShowInputCfg): QuickShowRet;
|
|
400
|
+
static showAudit(config: IShowInputCfg): QuickShowRet;
|
|
317
401
|
static showTable(config: IShowTableCfg): QuickShowRet;
|
|
318
402
|
static showBatchInput(config: IShowBatchInputCfg): QuickShowRet;
|
|
403
|
+
static showBatchByExcel(config: IShowBatchByExcelCfg): QuickShowRet;
|
|
404
|
+
static showBatchProcess(config: IShowBatchProcessCfg): QuickShowRet;
|
|
319
405
|
static confirmPromise(config: QuickShowConfig): Promise<boolean>;
|
|
320
406
|
static show(config: QuickShowConfig): QuickShowRet;
|
|
321
407
|
static alert(config: QuickShowConfig): QuickShowRet;
|
package/types/upload/index.d.ts
CHANGED
|
@@ -82,7 +82,14 @@ export interface ObjectFile extends CommonModifiedFile {
|
|
|
82
82
|
alt?: string;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
export interface IFileValueObject {
|
|
86
|
+
name?: string;
|
|
87
|
+
state?: string;
|
|
88
|
+
url?: string;
|
|
89
|
+
downloadURL?: string;
|
|
90
|
+
imgURL?: string;
|
|
91
|
+
size?: number;
|
|
92
|
+
}
|
|
86
93
|
|
|
87
94
|
export interface CardProps extends HTMLAttributesWeak, CommonProps {
|
|
88
95
|
/**
|
|
@@ -321,13 +328,31 @@ export interface CardProps extends HTMLAttributesWeak, CommonProps {
|
|
|
321
328
|
export class Card extends React.Component<CardProps, any> {}
|
|
322
329
|
|
|
323
330
|
export interface SimpleJSONUploadProps extends UploadProps, CardProps {
|
|
324
|
-
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* 可以指定上传组件
|
|
334
|
+
*/
|
|
335
|
+
uploadComponent?: any;
|
|
336
|
+
|
|
325
337
|
/**
|
|
326
338
|
* 上传文件改变时的状态。两个参数的OnChange函数,可以接收最原始的返回值。
|
|
327
339
|
*/
|
|
328
340
|
onChange2?: (value: File[], param2?: any) => void;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* 在Preview模式下,如何显示 预览效果
|
|
344
|
+
* 默认:default
|
|
345
|
+
*/
|
|
346
|
+
previewMode?: 'default' | 'auto' | 'image' | 'download' | 'weboffice' | 'auto-list';
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* 可以是标准的value数组,也可以是字符串
|
|
350
|
+
*/
|
|
351
|
+
value?: IFileValueObject | IFileValueObject[] | string;
|
|
329
352
|
}
|
|
330
353
|
|
|
354
|
+
|
|
355
|
+
|
|
331
356
|
export class SimpleJSONUpload extends React.Component<SimpleJSONUploadProps, any> {} {
|
|
332
357
|
|
|
333
358
|
}
|
|
@@ -529,12 +554,12 @@ export interface UploadProps extends HTMLAttributesWeak, CommonProps {
|
|
|
529
554
|
/**
|
|
530
555
|
* 文件列表
|
|
531
556
|
*/
|
|
532
|
-
value?:
|
|
557
|
+
value?: IFileValueObject[];
|
|
533
558
|
|
|
534
559
|
/**
|
|
535
560
|
* 默认文件列表
|
|
536
561
|
*/
|
|
537
|
-
defaultValue?:
|
|
562
|
+
defaultValue?: IFileValueObject[];
|
|
538
563
|
|
|
539
564
|
/**
|
|
540
565
|
* 上传按钮形状
|