onchain-uikit 0.0.7 → 3.9.4-alpha2
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/filePreview/fontawesome-webfont.woff2 +0 -0
- package/dist/filePreview/iconfont.css +457 -0
- package/dist/filePreview/loading.gif +0 -0
- package/dist/filePreview/logo.svg +1 -0
- package/dist/filePreview/luckyexcel.umd.js +26153 -0
- package/dist/filePreview/luckysheet.css +7145 -0
- package/dist/filePreview/luckysheet.umd.js +137608 -0
- package/dist/filePreview/plugin.js +29474 -0
- package/dist/filePreview/plugins.css +10 -0
- package/dist/filePreview/pluginsCss.css +1 -0
- package/dist/filePreview/waffle_sprite.png +0 -0
- package/dist/font/demo.css +539 -0
- package/dist/font/demo_index.html +20820 -0
- package/dist/font/iconfont.css +3604 -0
- package/dist/font/iconfont.js +70 -0
- package/dist/font/iconfont.json +6288 -0
- package/dist/font/iconfont.svg +1813 -0
- package/dist/font/iconfont.ttf +0 -0
- package/dist/font/iconfont.woff +0 -0
- package/dist/font/iconfont.woff2 +0 -0
- package/dist/index.cjs.js +529 -0
- package/dist/index.es.js +44594 -0
- package/dist/index.umd.js +633 -0
- package/dist/logo.svg +1 -0
- package/dist/onchain-uikit.css +10 -0
- package/dist/xlsx-C9icP-aY.mjs +24775 -0
- package/dist/xlsx-qn1xoUuv.js +105 -0
- package/lib/src/App.d.ts +1 -1
- package/lib/src/app/main/model/context.d.ts +30 -0
- package/lib/src/components/OnChainAI/index.d.ts +3 -0
- package/lib/src/{stories/Page.stories.d.ts → components/OnChainAI/index.stories.d.ts} +4 -2
- package/lib/src/components/OnChainAI/welcome.d.ts +6 -0
- package/lib/src/components/OnChainAdvancedSearch/index.d.ts +8 -0
- package/lib/src/{stories/XsButton.stories.d.ts → components/OnChainAdvancedSearch/index.stories.d.ts} +1 -1
- package/lib/src/components/OnChainBadge/index.d.ts +52 -0
- package/lib/src/{stories/PlmMosaic.stories.d.ts → components/OnChainBadge/index.stories.d.ts} +2 -2
- package/lib/src/components/OnChainCompositeForm/index.d.ts +26 -0
- package/lib/src/components/OnChainCompositeForm/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainDropMenu/index.d.ts +21 -0
- package/lib/src/components/OnChainDropMenu/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainExcelViewer/index.d.ts +8 -0
- package/lib/src/components/OnChainExcelViewer/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainForm/index.d.ts +14 -0
- package/lib/src/components/OnChainForm/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainFormItem/index.d.ts +175 -0
- package/lib/src/components/OnChainFormItem/index.stories.d.ts +19 -0
- package/lib/src/components/OnChainFormItem/title/index.d.ts +2 -0
- package/lib/src/components/OnChainGenAntImage/index.d.ts +5 -0
- package/lib/src/components/OnChainGenAntImage/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainGlobalLoading/index.d.ts +9 -0
- package/lib/src/components/OnChainGlobalLoading/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainHighLightWords/index.d.ts +9 -0
- package/lib/src/components/OnChainHighLightWords/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainIcon/index.d.ts +31 -0
- package/lib/src/components/OnChainIcon/index.stories.d.ts +15 -0
- package/lib/src/components/OnChainImage/index.d.ts +9 -0
- package/lib/src/components/OnChainImage/index.stories.d.ts +18 -0
- package/lib/src/components/OnChainInput/index.d.ts +13 -0
- package/lib/src/components/OnChainInput/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainLinkInstance/index.d.ts +1 -0
- package/lib/src/components/OnChainLoading/index.d.ts +10 -0
- package/lib/src/components/OnChainLoading/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainLoadingSkCube/index.d.ts +6 -0
- package/lib/src/components/OnChainLoadingSkCube/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainMarkdown/index.d.ts +16 -0
- package/lib/src/components/OnChainMarkdown/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainModal/index.d.ts +22 -0
- package/lib/src/components/OnChainModal/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainMosaic/index.d.ts +7 -0
- package/lib/src/components/OnChainMosaic/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainPopoverTransfer/index.d.ts +49 -0
- package/lib/src/components/OnChainPopoverTransfer/select/index.d.ts +18 -0
- package/lib/src/components/OnChainPopupSelect/index.d.ts +32 -0
- package/lib/src/components/OnChainPopupSelect/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainProgress/index.d.ts +7 -0
- package/lib/src/components/OnChainProgress/index.stories.d.ts +16 -0
- package/lib/src/components/OnChainProvider/index.d.ts +18 -0
- package/lib/src/components/OnChainProvider/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainPublicTree/index.d.ts +20 -0
- package/lib/src/components/OnChainPublicTree/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainQueryBuilder/AbcSelectTransfer/index.d.ts +15 -0
- package/lib/src/components/OnChainQueryBuilder/index.d.ts +31 -0
- package/lib/src/components/OnChainResourceTree/index.d.ts +26 -0
- package/lib/src/components/OnChainResourceTree/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainScrollBar/index.d.ts +7 -0
- package/lib/src/components/OnChainScrollBar/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainScrollBarAssembly/index.d.ts +11 -0
- package/lib/src/components/OnChainScrollBarAssembly/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainSelect/index.d.ts +14 -0
- package/lib/src/{stories/PlmSelect/PlmSelect.stories.d.ts → components/OnChainSelect/index.stories.d.ts} +8 -3
- package/lib/src/components/OnChainSelectPopupForm/index.d.ts +45 -0
- package/lib/src/components/OnChainSelectPopupForm/select/index.d.ts +20 -0
- package/lib/src/components/OnChainTable/ContextMenu.d.ts +8 -0
- package/lib/src/components/OnChainTable/EditableCell.d.ts +39 -0
- package/lib/src/components/OnChainTable/EditableRow.d.ts +6 -0
- package/lib/src/components/OnChainTable/OnChainTableFormItem/index.d.ts +14 -0
- package/lib/src/components/OnChainTable/ResizableTitle.d.ts +2 -0
- package/lib/src/components/OnChainTable/TableFooter.d.ts +13 -0
- package/lib/src/components/OnChainTable/TableUtils.d.ts +78 -0
- package/lib/src/components/OnChainTable/const.d.ts +2 -0
- package/lib/src/components/OnChainTable/index.d.ts +101 -0
- package/lib/src/components/OnChainTable/index.stories.d.ts +28 -0
- package/lib/src/components/OnChainTable/type.d.ts +10 -0
- package/lib/src/components/OnChainTable/useClipboard.d.ts +67 -0
- package/lib/src/components/OnChainTable/useColumn.d.ts +5 -0
- package/lib/src/components/OnChainTable/useCopy.d.ts +5 -0
- package/lib/src/components/OnChainTable/useDynamicHeight.d.ts +13 -0
- package/lib/src/components/OnChainTable/useFiltered.d.ts +23 -0
- package/lib/src/components/OnChainTable/usePaste.d.ts +5 -0
- package/lib/src/components/OnChainTable/useVirtualScroll.d.ts +3 -0
- package/lib/src/components/OnChainTable/virtualScroll.d.ts +91 -0
- package/lib/src/components/OnChainTableSelection/index.d.ts +40 -0
- package/lib/src/components/OnChainTableSelection/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainTabs/index.d.ts +20 -0
- package/lib/src/components/OnChainTabs/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainViewerError/index.d.ts +6 -0
- package/lib/src/components/OnChainViewerError/index.stories.d.ts +14 -0
- package/lib/src/components/OnChainformUploader/index.d.ts +1 -0
- package/lib/src/components/PlmSearchSelect/index.d.ts +18 -0
- package/lib/src/hooks/useShortcutKey/index.d.ts +5 -0
- package/lib/src/hooks/useStore/index.d.ts +14 -0
- package/lib/src/index.d.ts +32 -4
- package/lib/src/language/index.d.ts +23 -0
- package/lib/src/language/translate.d.ts +5 -0
- package/lib/src/types/gantt.d.ts +269 -0
- package/lib/src/typings.d.ts +610 -612
- package/lib/src/utils/attribute.d.ts +70 -0
- package/lib/src/utils/authority/basicsAuthority.d.ts +0 -5
- package/lib/src/utils/authority/const.d.ts +30 -0
- package/lib/src/utils/itemCode.d.ts +159 -0
- package/lib/src/utils/utility.d.ts +46 -0
- package/lib/typings.d.ts +126 -130
- package/package.json +31 -7
- package/lib/instance.cjs.mjs +0 -366
- package/lib/instance.es.mjs +0 -29301
- package/lib/instance.umd.mjs +0 -366
- package/lib/src/components/PlmMosaic/index.d.ts +0 -5
- package/lib/src/stories/Button.d.ts +0 -14
- package/lib/src/stories/Button.stories.d.ts +0 -23
- package/lib/src/stories/Header.d.ts +0 -11
- package/lib/src/stories/Header.stories.d.ts +0 -18
- package/lib/src/stories/OnChainProvider.d.ts +0 -12
- package/lib/src/stories/Page.d.ts +0 -2
- package/lib/src/stories/PlmSelect/index.d.ts +0 -20
- package/lib/src/stories/XsButton.d.ts +0 -22
- /package/{lib → dist}/vite.svg +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { contentProps } from '../OnChainFormItem';
|
|
3
|
+
interface Item {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
age: string;
|
|
7
|
+
address: string;
|
|
8
|
+
[k: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface EditableCellProps {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
menuId: string;
|
|
14
|
+
editable: boolean;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
dataIndex: keyof Item;
|
|
17
|
+
rowKey: string;
|
|
18
|
+
tableKey: string;
|
|
19
|
+
record: Item;
|
|
20
|
+
fillContextMenu?: false;
|
|
21
|
+
handleSave: (record: Item) => void;
|
|
22
|
+
handleCellSelected: () => void;
|
|
23
|
+
handleFill: (record: Item) => void;
|
|
24
|
+
handleDoubleClick: (record: Item) => boolean;
|
|
25
|
+
selectedCell?: Record<string, any>;
|
|
26
|
+
formitem: contentProps;
|
|
27
|
+
required: boolean;
|
|
28
|
+
render: any;
|
|
29
|
+
highlight: any;
|
|
30
|
+
isVersion: boolean;
|
|
31
|
+
renderCacheCell: React.ReactNode;
|
|
32
|
+
preRender: React.ReactNode;
|
|
33
|
+
isUser: boolean;
|
|
34
|
+
apicode: string;
|
|
35
|
+
canselectcell?: boolean;
|
|
36
|
+
setInitialState: (s: any) => any;
|
|
37
|
+
}
|
|
38
|
+
declare const EditableCell: React.FC<EditableCellProps>;
|
|
39
|
+
export default EditableCell;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { contentProps } from '../../OnChainFormItem';
|
|
2
|
+
import { BaseComponentProps } from '../../../typings';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
export interface PlmTableFormItemProps extends BaseComponentProps {
|
|
5
|
+
formprops: contentProps;
|
|
6
|
+
onSave?: () => void;
|
|
7
|
+
name: any;
|
|
8
|
+
value?: any;
|
|
9
|
+
record?: any;
|
|
10
|
+
apicode?: any;
|
|
11
|
+
}
|
|
12
|
+
export declare const inputFormat: Record<string, string>;
|
|
13
|
+
declare const PlmTableFormItem: React.ForwardRefExoticComponent<Omit<PlmTableFormItemProps, "ref"> & React.RefAttributes<any>>;
|
|
14
|
+
export default PlmTableFormItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { PlmTableProps } from '.';
|
|
3
|
+
import { TableFooterDataRender } from './type';
|
|
4
|
+
interface TableFooterProps extends Pick<PlmTableProps, 'hideFooter' | 'hideTableCount' | 'dataSource' | 'loading' | 'rowSelection' | 'total'> {
|
|
5
|
+
enterFullscreen: (() => void) | undefined;
|
|
6
|
+
clearFilters: (params?: {
|
|
7
|
+
isFooterRefresh?: boolean;
|
|
8
|
+
}) => void;
|
|
9
|
+
customRender?: TableFooterDataRender;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const TableFooter: FC<TableFooterProps>;
|
|
13
|
+
export default TableFooter;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { BasicsAttribute } from '../../utils/attribute';
|
|
2
|
+
import { PlmColumn } from '.';
|
|
3
|
+
import { contentProps } from '../OnChainFormItem';
|
|
4
|
+
import { PlmTableFormItemProps } from './OnChainTableFormItem';
|
|
5
|
+
interface tabInfoProps {
|
|
6
|
+
itemCode: string | number;
|
|
7
|
+
tabCode: string | number;
|
|
8
|
+
tabName: string;
|
|
9
|
+
tab: string;
|
|
10
|
+
extValue?: any;
|
|
11
|
+
}
|
|
12
|
+
declare class TableUtils {
|
|
13
|
+
static getTrulyHighlight: ({ formitem, highlight, }: {
|
|
14
|
+
formitem: PlmTableFormItemProps["formprops"];
|
|
15
|
+
highlight?: string[];
|
|
16
|
+
}) => {
|
|
17
|
+
trulyHighlight: any;
|
|
18
|
+
needTransform: boolean;
|
|
19
|
+
};
|
|
20
|
+
static wrapperHighLight: ({ highlight, formitem, value, originValue, }: {
|
|
21
|
+
originValue: any;
|
|
22
|
+
highlight?: string[];
|
|
23
|
+
formitem: contentProps;
|
|
24
|
+
value: string;
|
|
25
|
+
}) => string | import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
static renderCacheCell: (row: Record<string, any>, dataIndex: string, formitem: contentProps, customRender?: (data: any) => any, options?: {
|
|
27
|
+
highlight?: string[];
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
static renderReadonlyItem: ({ apicode, formitem, value, record, }: {
|
|
30
|
+
apicode?: string;
|
|
31
|
+
formitem: contentProps;
|
|
32
|
+
value: string | any[];
|
|
33
|
+
record?: Record<string, any>;
|
|
34
|
+
}) => any;
|
|
35
|
+
static renderRowClassName: (record: Record<string, any>) => string;
|
|
36
|
+
static renderVersionColumn: (value: string, highlight?: string[]) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
static avoid0TypeConvert(value: any): any;
|
|
38
|
+
static isEqual(old: any, value: any): any;
|
|
39
|
+
static getCellSignState(row: Record<string, any>, dataIndex: string): {
|
|
40
|
+
hasOptType: boolean;
|
|
41
|
+
hasInProcess: any;
|
|
42
|
+
hasNewValue: any;
|
|
43
|
+
};
|
|
44
|
+
static getRowSignState(row: Record<string, any>, handleCellIsEq?: (type: 'newVal' | 'inProcess', dataIndex: string, isEq: boolean, latestValue: any, oldValue: any) => void): {
|
|
45
|
+
hasOptType: boolean;
|
|
46
|
+
hasInProcess: boolean;
|
|
47
|
+
hasNewValue: boolean;
|
|
48
|
+
};
|
|
49
|
+
static isEmptyValue(latest: any): any;
|
|
50
|
+
static sortAndFilterTable(params: {
|
|
51
|
+
sorters: string;
|
|
52
|
+
filters: string;
|
|
53
|
+
sortersField: string;
|
|
54
|
+
/** 前端处理后的 columns */
|
|
55
|
+
tableColumns: PlmColumn[];
|
|
56
|
+
/** 版次记录页签、历史记录页签 需要该属性进行额外处理 */
|
|
57
|
+
tabInfo?: Partial<tabInfoProps>;
|
|
58
|
+
/** 服务端原始属性(版次记录页签需要该属性进行额外处理)*/
|
|
59
|
+
originTableColumns?: BasicsAttribute[];
|
|
60
|
+
}): {
|
|
61
|
+
sorters: string;
|
|
62
|
+
filters: string;
|
|
63
|
+
sortersField: string;
|
|
64
|
+
};
|
|
65
|
+
static monitoringCol(box: Element, columnWidth?: number | string): () => void;
|
|
66
|
+
static getFixAttrFilterOrSortInfo({ filterOrSort, attrs, }: {
|
|
67
|
+
filterOrSort: string;
|
|
68
|
+
attrs: BasicsAttribute[];
|
|
69
|
+
}): {
|
|
70
|
+
apicode: string;
|
|
71
|
+
id: string;
|
|
72
|
+
attr: BasicsAttribute<string>;
|
|
73
|
+
filterOrSortValue: any;
|
|
74
|
+
prefix: string;
|
|
75
|
+
value: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
}
|
|
78
|
+
export default TableUtils;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableProps, TableColumnType } from 'antd';
|
|
3
|
+
import { FormInstance } from 'antd/lib/form';
|
|
4
|
+
import { APP, BaseComponentProps } from '../../typings';
|
|
5
|
+
import { TableFooterDataRender } from './type';
|
|
6
|
+
import { Clipboard, useClipboard } from './useClipboard';
|
|
7
|
+
import { BasicsAttribute } from '../../utils/attribute';
|
|
8
|
+
interface extendColumnType extends TableColumnType<any> {
|
|
9
|
+
attr: BasicsAttribute<any>;
|
|
10
|
+
tabInfo: any;
|
|
11
|
+
instance: APP.instanceInfoType;
|
|
12
|
+
id: string;
|
|
13
|
+
sort: number;
|
|
14
|
+
ellipsis: boolean;
|
|
15
|
+
valueType: string;
|
|
16
|
+
apicode: string;
|
|
17
|
+
dataFrom: string;
|
|
18
|
+
addDefValue: string;
|
|
19
|
+
dataIndex: string;
|
|
20
|
+
width: number | string;
|
|
21
|
+
required: boolean;
|
|
22
|
+
align: 'center' | undefined;
|
|
23
|
+
sorter: boolean;
|
|
24
|
+
search: any;
|
|
25
|
+
isUser: boolean;
|
|
26
|
+
canNotView: boolean;
|
|
27
|
+
editable: boolean;
|
|
28
|
+
fixed?: boolean;
|
|
29
|
+
title?: any;
|
|
30
|
+
formitem?: any;
|
|
31
|
+
render?: any;
|
|
32
|
+
listCodeMap?: any;
|
|
33
|
+
}
|
|
34
|
+
export type singleColumnType = Partial<extendColumnType>;
|
|
35
|
+
export type TableColumnsType = Partial<extendColumnType>[];
|
|
36
|
+
export interface PlmTableProps extends TableProps<any>, BaseComponentProps {
|
|
37
|
+
selectedCell?: Record<string, any>;
|
|
38
|
+
columns: TableColumnsType;
|
|
39
|
+
onSubmit?: (values: any, col: any) => void;
|
|
40
|
+
onSelectCell?: () => void;
|
|
41
|
+
onDoubleClick?: (col: any, record: any) => Promise<boolean> | boolean;
|
|
42
|
+
onTableHeightChange?: (height: number) => void;
|
|
43
|
+
onFill?: (type: string, values: any) => void;
|
|
44
|
+
onBeforeScroll?: () => boolean;
|
|
45
|
+
isTree?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Table的粘贴回调
|
|
48
|
+
* @param selectedCell 粘贴的selectedCell位置
|
|
49
|
+
* @param pasteData 粘贴数据
|
|
50
|
+
* @param columns 用于粘贴多列,拿到后续每列的dataIndex
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
onPaste?: (pasteData: Record<string, any>) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Table的复制回调
|
|
56
|
+
* @param copyData 复制数据
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
onCopy?: (copyData: string) => void;
|
|
60
|
+
clipboard?: Clipboard;
|
|
61
|
+
tab?: string;
|
|
62
|
+
pageNo?: number;
|
|
63
|
+
pageSize?: number;
|
|
64
|
+
total?: number;
|
|
65
|
+
scrollUpdate?: (isFullscreen: boolean, autoHeight: number) => void;
|
|
66
|
+
toggleFullscreen?: () => void;
|
|
67
|
+
isFullscreen?: boolean;
|
|
68
|
+
showcheckbox?: boolean;
|
|
69
|
+
canselectcell?: boolean;
|
|
70
|
+
tableKey?: string;
|
|
71
|
+
onScroll?: (pageNo: number) => void;
|
|
72
|
+
onFilterAndSorter?: (sorters: string, filters: string, sortersField: string, filtersObject: any, extra?: {
|
|
73
|
+
isFooterRefresh?: boolean;
|
|
74
|
+
}) => void;
|
|
75
|
+
hideFooter?: boolean;
|
|
76
|
+
hideTableCount?: boolean;
|
|
77
|
+
/** 屏蔽右键菜单 */
|
|
78
|
+
fillContextMenu?: false;
|
|
79
|
+
/** 全屏时tableHeight需要减少的高度(例如有按钮在时,这个值为的按钮高度 40) */
|
|
80
|
+
fullScreenMinusHeight?: number;
|
|
81
|
+
searchHeight?: boolean;
|
|
82
|
+
/** 自定义渲染底部数据 */
|
|
83
|
+
tableFooterDateRender?: TableFooterDataRender;
|
|
84
|
+
tableFooterClassName?: string;
|
|
85
|
+
}
|
|
86
|
+
export type PlmColumn = Partial<extendColumnType>;
|
|
87
|
+
export type PlmTableColumnProps = Partial<extendColumnType>[];
|
|
88
|
+
export declare const EditableContext: React.Context<FormInstance<any> | null>;
|
|
89
|
+
export interface PlmTableRef {
|
|
90
|
+
scrollTo: (y: number) => void;
|
|
91
|
+
scrollXTo: (x: number) => void;
|
|
92
|
+
clearFilters: () => void;
|
|
93
|
+
setTableFiltered: (params: {
|
|
94
|
+
sort: (data: any) => Record<string, any>;
|
|
95
|
+
screen: (data: any) => Record<string, any[]>;
|
|
96
|
+
}) => void;
|
|
97
|
+
clipboard: ReturnType<typeof useClipboard>;
|
|
98
|
+
}
|
|
99
|
+
export declare const GLOBAL_TABLE_TOP_CLASS = "tableTopBox";
|
|
100
|
+
declare const OnChainTable: React.ForwardRefExoticComponent<Omit<PlmTableProps, "ref"> & React.RefAttributes<PlmTableRef>>;
|
|
101
|
+
export default OnChainTable;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('.').PlmTableProps, "ref"> & import('react').RefAttributes<import('.').PlmTableRef>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {
|
|
10
|
+
style: {
|
|
11
|
+
width: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
args: {
|
|
15
|
+
/** 列表值 */
|
|
16
|
+
dataSource: {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
20
|
+
columns: {
|
|
21
|
+
dataIndex: string;
|
|
22
|
+
title: string;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
export declare const Large: Story;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PlmTableProps } from '.';
|
|
2
|
+
import { ClipboardArray } from '../../typings';
|
|
3
|
+
type PasteInto = 'child' | 'sibling';
|
|
4
|
+
export interface Clipboard {
|
|
5
|
+
setDataSource: <T = any>(type: 'shear' | 'copy' | 'paste', data: T[]) => void;
|
|
6
|
+
pasteInto?: PasteInto;
|
|
7
|
+
/** 子所在的属性名称,默认`children` */
|
|
8
|
+
childKeyName?: string;
|
|
9
|
+
/** 是否使用红线标记,默认`true` */
|
|
10
|
+
isMark?: boolean;
|
|
11
|
+
/** 剪切前触发 */
|
|
12
|
+
onBeforeShear?: <T = any>(rows: T[]) => Promise<boolean>;
|
|
13
|
+
/** 剪切后触发 */
|
|
14
|
+
onAfterShear?: <T = any>(rows: T[]) => void;
|
|
15
|
+
/** 剪切的数据删除前触发 */
|
|
16
|
+
onBeforeDeleteShear?: <T = any>(params: {
|
|
17
|
+
/** 是否在中一个table内 */ isSameSpace: boolean;
|
|
18
|
+
deletes: T[];
|
|
19
|
+
}) => Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* 剪切的数据删除后触发
|
|
22
|
+
* ```js
|
|
23
|
+
* if(isSameSpace) {
|
|
24
|
+
* // 当前table内触发的剪切删除
|
|
25
|
+
* } else {
|
|
26
|
+
* // 其他table内触发的剪切删除
|
|
27
|
+
* runSave()
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
onAfterDeleteShear?: <T = any>(params: {
|
|
32
|
+
/** 是否在中一个table内 */ isSameSpace: boolean;
|
|
33
|
+
deletes: T[];
|
|
34
|
+
}) => Promise<boolean>;
|
|
35
|
+
/** 复制前触发 */
|
|
36
|
+
onBeforeCopy?: <T = any>(rows: T[]) => Promise<boolean>;
|
|
37
|
+
/** 复制后触发 */
|
|
38
|
+
onAfterCopy?: <T = any>(rows: T[]) => void;
|
|
39
|
+
/** 粘贴前触发 */
|
|
40
|
+
onBeforePaste?: <T = any>(params: {
|
|
41
|
+
target: T;
|
|
42
|
+
rows: T[];
|
|
43
|
+
type: PasteInto;
|
|
44
|
+
}) => Promise<boolean>;
|
|
45
|
+
/** 粘贴后触发 */
|
|
46
|
+
onAfterPaste?: <T = any>(params: {
|
|
47
|
+
target: T;
|
|
48
|
+
type: PasteInto;
|
|
49
|
+
}) => void;
|
|
50
|
+
/** 回调设置值 */
|
|
51
|
+
setInitialState?: (data: any) => any;
|
|
52
|
+
/** 初始值 */
|
|
53
|
+
initialState?: any;
|
|
54
|
+
}
|
|
55
|
+
export declare const useClipboard: (params: PlmTableProps, namespace: string) => {
|
|
56
|
+
namespace: string;
|
|
57
|
+
isGainFocus: boolean;
|
|
58
|
+
focus: () => void;
|
|
59
|
+
shear: (clipboard: Clipboard, data: any[]) => Promise<void>;
|
|
60
|
+
copy: (clipboard: Clipboard, data: any[]) => Promise<void>;
|
|
61
|
+
paste: (clipboard: Clipboard, { pasteData, pasteTarget, }: {
|
|
62
|
+
pasteData: ClipboardArray;
|
|
63
|
+
pasteTarget: React.Key[];
|
|
64
|
+
}) => Promise<void>;
|
|
65
|
+
FocusDom: import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PlmTableProps } from '.';
|
|
2
|
+
declare const useColumn: (props: PlmTableProps, sortInfo: any, filterInfo: any, menuId: string, getColumnSearchProps: any, tableHeight: number, selectedCell?: Record<string, any>) => {
|
|
3
|
+
renderColumns: any[];
|
|
4
|
+
};
|
|
5
|
+
export default useColumn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableProps } from 'antd';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { PlmTableProps } from '.';
|
|
4
|
+
declare const useDynamicHeight: ({ hideFooter, contentRef, tableRef, scroll, fullScreenMinusHeight, scrollUpdate, onTableHeightChange, }: {
|
|
5
|
+
scroll: TableProps<any>["scroll"];
|
|
6
|
+
hideFooter: boolean | undefined;
|
|
7
|
+
fullScreenMinusHeight?: number;
|
|
8
|
+
contentRef: React.MutableRefObject<null>;
|
|
9
|
+
tableRef: React.MutableRefObject<null>;
|
|
10
|
+
onTableHeightChange: PlmTableProps["onTableHeightChange"];
|
|
11
|
+
scrollUpdate?: (isFullscreen: boolean, autoHeight: number) => void;
|
|
12
|
+
}, deps: boolean) => number;
|
|
13
|
+
export { useDynamicHeight };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PlmTableProps } from '.';
|
|
2
|
+
declare const useFiltered: (onFilterAndSorter: PlmTableProps["onFilterAndSorter"]) => {
|
|
3
|
+
getColumnSearchProps: (dataIndex: string, column: any) => {
|
|
4
|
+
filterIcon: (filtered: boolean) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }: any) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
onFilterDropdownVisibleChange: (visible: boolean) => void;
|
|
7
|
+
} | {
|
|
8
|
+
filterIcon?: undefined;
|
|
9
|
+
filterDropdown?: undefined;
|
|
10
|
+
onFilterDropdownVisibleChange?: undefined;
|
|
11
|
+
};
|
|
12
|
+
setTableFiltered: (params: {
|
|
13
|
+
sort: (data: any) => Record<string, any>;
|
|
14
|
+
screen: (data: any) => Record<string, any[]>;
|
|
15
|
+
}) => void;
|
|
16
|
+
clearFilters: (params?: {
|
|
17
|
+
isFooterRefresh?: boolean;
|
|
18
|
+
}) => void;
|
|
19
|
+
onFiltersChange: (pagination: any, filters: any, sorters: any, extra: any) => void;
|
|
20
|
+
sortInfo: any;
|
|
21
|
+
filterInfo: any;
|
|
22
|
+
};
|
|
23
|
+
export default useFiltered;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type CustomizeComponent = React.FC<any>;
|
|
3
|
+
export interface TableComponents {
|
|
4
|
+
table?: CustomizeComponent;
|
|
5
|
+
header?: {
|
|
6
|
+
wrapper?: CustomizeComponent;
|
|
7
|
+
row?: CustomizeComponent;
|
|
8
|
+
cell?: CustomizeComponent;
|
|
9
|
+
};
|
|
10
|
+
body?: {
|
|
11
|
+
wrapper?: CustomizeComponent;
|
|
12
|
+
row?: CustomizeComponent;
|
|
13
|
+
cell?: CustomizeComponent;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface RefObject {
|
|
17
|
+
scrollTo: (y: number) => void;
|
|
18
|
+
scrollToIndex: (idx: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface VtOpts {
|
|
21
|
+
id?: number | string;
|
|
22
|
+
/**
|
|
23
|
+
* @default 5
|
|
24
|
+
*/
|
|
25
|
+
overscanRowCount?: number;
|
|
26
|
+
/**
|
|
27
|
+
* this only needs the scroll.y
|
|
28
|
+
*/
|
|
29
|
+
scroll: {
|
|
30
|
+
y: number | string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* wheel event(only works on native events).
|
|
34
|
+
*/
|
|
35
|
+
onScroll?: ({ left, top, isEnd }: {
|
|
36
|
+
top: number;
|
|
37
|
+
left: number;
|
|
38
|
+
isEnd: boolean;
|
|
39
|
+
}) => void;
|
|
40
|
+
initTop?: number;
|
|
41
|
+
/**
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
debug?: boolean;
|
|
45
|
+
ref?: React.MutableRefObject<RefObject>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `INIT` -> `LOADED` -> `RUNNING`
|
|
49
|
+
*/
|
|
50
|
+
declare enum e_VT_STATE {
|
|
51
|
+
INIT = 1,
|
|
52
|
+
LOADED = 2,
|
|
53
|
+
RUNNING = 4
|
|
54
|
+
}
|
|
55
|
+
interface VT_CONTEXT extends VtOpts {
|
|
56
|
+
_y: number;
|
|
57
|
+
_scroll_y: number | string;
|
|
58
|
+
_vtcomponents: TableComponents;
|
|
59
|
+
components: TableComponents;
|
|
60
|
+
vt_state: e_VT_STATE;
|
|
61
|
+
possible_hight_per_tr: number;
|
|
62
|
+
re_computed: number;
|
|
63
|
+
row_height: number[];
|
|
64
|
+
row_count: number;
|
|
65
|
+
prev_row_count: number;
|
|
66
|
+
wrap_inst: React.RefObject<HTMLDivElement>;
|
|
67
|
+
VTScroll?: (param?: {
|
|
68
|
+
top: number;
|
|
69
|
+
left: number;
|
|
70
|
+
}) => {
|
|
71
|
+
top: number;
|
|
72
|
+
left: number;
|
|
73
|
+
};
|
|
74
|
+
computed_h: number;
|
|
75
|
+
WH: number;
|
|
76
|
+
HND_PAINT: number;
|
|
77
|
+
_offset_top: number;
|
|
78
|
+
_offset_head: number;
|
|
79
|
+
_offset_tail: number;
|
|
80
|
+
top: number;
|
|
81
|
+
left: number;
|
|
82
|
+
evt: number;
|
|
83
|
+
end: boolean;
|
|
84
|
+
final_top: number;
|
|
85
|
+
f_final_top: number;
|
|
86
|
+
update_count: number;
|
|
87
|
+
on_update_wrap_style: () => void;
|
|
88
|
+
}
|
|
89
|
+
export declare function _set_components(ctx: VT_CONTEXT, components: TableComponents): void;
|
|
90
|
+
export declare function init(fnOpts: () => VtOpts, deps: React.DependencyList): VT_CONTEXT;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TableSelectionProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
title: string;
|
|
5
|
+
visible: boolean;
|
|
6
|
+
columns: any;
|
|
7
|
+
url: string;
|
|
8
|
+
enter?: boolean;
|
|
9
|
+
params?: any;
|
|
10
|
+
formate?: any;
|
|
11
|
+
isCheckbox?: boolean;
|
|
12
|
+
width?: number;
|
|
13
|
+
isBroadside?: boolean;
|
|
14
|
+
height?: number;
|
|
15
|
+
noSearch?: boolean;
|
|
16
|
+
isSelect?: boolean;
|
|
17
|
+
allCategories?: boolean;
|
|
18
|
+
itemCode?: string;
|
|
19
|
+
isDownload?: boolean;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
placeholderCode?: string;
|
|
22
|
+
searchChange?: (e: any) => void;
|
|
23
|
+
isUseRuleSort?: boolean;
|
|
24
|
+
isBuiltInSort?: boolean;
|
|
25
|
+
notIdList?: any;
|
|
26
|
+
tableColumns?: any;
|
|
27
|
+
onCancel: () => void;
|
|
28
|
+
maxSelect?: number;
|
|
29
|
+
convertFun?: any;
|
|
30
|
+
isLibrary?: boolean;
|
|
31
|
+
onChange?: (e: any) => void;
|
|
32
|
+
handleSubmit?: (e: any, v: any) => void;
|
|
33
|
+
onInit?: (data: any) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface PlmBorrowRefProps {
|
|
36
|
+
getLoading: (e: any) => void;
|
|
37
|
+
backfill: (e: any) => void;
|
|
38
|
+
}
|
|
39
|
+
declare const TableSelection: React.FC<TableSelectionProps>;
|
|
40
|
+
export default TableSelection;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').FC<import('.').TableSelectionProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Init: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../typings';
|
|
3
|
+
export interface Panes {
|
|
4
|
+
tab: string | React.ReactNode;
|
|
5
|
+
tabKey: string | number;
|
|
6
|
+
}
|
|
7
|
+
export interface OnChainInstanceTabsProps extends BaseComponentProps {
|
|
8
|
+
panes: Panes[];
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
defaultActiveKey?: string;
|
|
11
|
+
onTabClick?: (key: string) => boolean | void;
|
|
12
|
+
}
|
|
13
|
+
export interface OnChainInstanceTabsRef<T = string> {
|
|
14
|
+
active: (key: T) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Tabs
|
|
18
|
+
*/
|
|
19
|
+
declare const OnChainTabs: React.ForwardRefExoticComponent<Omit<OnChainInstanceTabsProps, "ref"> & React.RefAttributes<OnChainInstanceTabsRef<string>>>;
|
|
20
|
+
export default OnChainTabs;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('.').OnChainInstanceTabsProps, "ref"> & import('react').RefAttributes<import('.').OnChainInstanceTabsRef<string>>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Init: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').FC;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Init: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SelectProps } from 'antd';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface PlmPopupSelectProps {
|
|
4
|
+
url: any;
|
|
5
|
+
onChange?: (url: string) => {};
|
|
6
|
+
value?: any;
|
|
7
|
+
fieldNames?: Object;
|
|
8
|
+
params?: Object;
|
|
9
|
+
ischeckbox?: boolean;
|
|
10
|
+
getPageList?: (...arg: any[]) => any;
|
|
11
|
+
}
|
|
12
|
+
export interface DebounceSelectProps<ValueType = any> extends Omit<SelectProps<ValueType>, 'options' | 'children'> {
|
|
13
|
+
fetchOptions: (search: string, props: any) => Promise<ValueType[]>;
|
|
14
|
+
debounceTimeout?: number;
|
|
15
|
+
options: ValueType[];
|
|
16
|
+
}
|
|
17
|
+
declare const PlmSearchSelect: FC<PlmPopupSelectProps>;
|
|
18
|
+
export default PlmSearchSelect;
|