@apia/uploader-component 5.0.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/dist/index.d.ts +203 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1591 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as _apia_uploader_controller from '@apia/uploader-controller';
|
|
3
|
+
import { UploaderApi, UploaderModalController, TUploaderFileInfo, TDocumentPermission, TDocumentInformation } from '@apia/uploader-controller';
|
|
4
|
+
import react, { ReactNode } from 'react';
|
|
5
|
+
import { TTreeIconRenderer, TTreeLabelRenderer } from '@apia/tree2-component';
|
|
6
|
+
|
|
7
|
+
declare function makeDocTypeTooltip(api: UploaderApi, docTypes?: DocTypeInfo[]): react_jsx_runtime.JSX.Element;
|
|
8
|
+
type DocTypeInfo = {
|
|
9
|
+
extensions: string[];
|
|
10
|
+
id: string;
|
|
11
|
+
maxSize: number;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
declare const FileUploadProvider: ({ store, children, }: {
|
|
16
|
+
store: UploaderModalController;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare const useFileUploadContext: () => UploaderModalController;
|
|
20
|
+
|
|
21
|
+
declare function openUploaderModal(c: UploaderModalController): void;
|
|
22
|
+
|
|
23
|
+
declare const UploaderContent: (() => react_jsx_runtime.JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare const Permissions: (() => react_jsx_runtime.JSX.Element) & {
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare const AddFileSection: (() => react_jsx_runtime.JSX.Element) & {
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
declare const UploaderFileHeader: (() => react_jsx_runtime.JSX.Element) & {
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
declare class MetadataTable {
|
|
40
|
+
activeCell: {
|
|
41
|
+
row: number;
|
|
42
|
+
col: number;
|
|
43
|
+
} | null;
|
|
44
|
+
lastSelectedIndex: number | null;
|
|
45
|
+
selectedIndices: number[];
|
|
46
|
+
cellRefs: {
|
|
47
|
+
[key: string]: HTMLElement | null;
|
|
48
|
+
};
|
|
49
|
+
onDelete?: () => void;
|
|
50
|
+
constructor();
|
|
51
|
+
setActiveCell(cell: {
|
|
52
|
+
row: number;
|
|
53
|
+
col: number;
|
|
54
|
+
}): void;
|
|
55
|
+
setLastSelectedIndex(index: number): void;
|
|
56
|
+
setSelectedIndices(indices: number[]): void;
|
|
57
|
+
updateCellRef(key: string, el: HTMLElement | null): void;
|
|
58
|
+
getRange(start: number, end: number): number[];
|
|
59
|
+
focusCell(rowI: number, colI: number): void;
|
|
60
|
+
handleRowClick(index: number, e?: MouseEvent, isSelectable?: boolean, colIndex?: number): void;
|
|
61
|
+
handleKeyDown(e: react.KeyboardEvent<HTMLElement>, columns: any[], listLength: number, isRowSelectable: (rowIndex: number) => boolean): void;
|
|
62
|
+
reset(): void;
|
|
63
|
+
component: (() => react_jsx_runtime.JSX.Element) & {
|
|
64
|
+
displayName: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare const Directory: (() => react_jsx_runtime.JSX.Element | null) & {
|
|
69
|
+
displayName: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
declare const FileIconRenderer: TTreeIconRenderer;
|
|
73
|
+
|
|
74
|
+
declare const FolderIconRenderer: TTreeIconRenderer;
|
|
75
|
+
|
|
76
|
+
declare const LoadMoreRenderer: TTreeLabelRenderer;
|
|
77
|
+
|
|
78
|
+
declare const LockedFolderIconRenderer: TTreeIconRenderer;
|
|
79
|
+
|
|
80
|
+
declare const DeleteDocument: (api: UploaderApi, f: TUploaderFileInfo, props?: {
|
|
81
|
+
langId?: number;
|
|
82
|
+
}) => {
|
|
83
|
+
children: react_jsx_runtime.JSX.Element;
|
|
84
|
+
key: string;
|
|
85
|
+
onClick: () => Promise<void>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
declare const DownloadDocument: (api: UploaderApi, file: TUploaderFileInfo) => {
|
|
89
|
+
children: react_jsx_runtime.JSX.Element;
|
|
90
|
+
key: string;
|
|
91
|
+
onClick: () => void;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
declare const EditDocument: (api: UploaderApi, file: TUploaderFileInfo) => {
|
|
95
|
+
children: react_jsx_runtime.JSX.Element;
|
|
96
|
+
key: string;
|
|
97
|
+
onClick: () => void;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
declare const LockDocument: (api: UploaderApi, file: TUploaderFileInfo) => {
|
|
101
|
+
icon: string | false | undefined;
|
|
102
|
+
children: react_jsx_runtime.JSX.Element;
|
|
103
|
+
key: string;
|
|
104
|
+
onClick: () => void;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare const TranslateDocument: (api: UploaderApi, file: TUploaderFileInfo) => {
|
|
108
|
+
children: react_jsx_runtime.JSX.Element;
|
|
109
|
+
key: string;
|
|
110
|
+
onClick: () => void;
|
|
111
|
+
};
|
|
112
|
+
declare const TranslateDocumentModal: (({ api, file }: {
|
|
113
|
+
api: UploaderApi;
|
|
114
|
+
file: TUploaderFileInfo;
|
|
115
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
116
|
+
displayName: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
declare const VersionDocument: (api: UploaderApi, file: TUploaderFileInfo) => {
|
|
120
|
+
children: react_jsx_runtime.JSX.Element;
|
|
121
|
+
key: string;
|
|
122
|
+
onClick: () => Promise<void>;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare const DocInfoModal: (api: UploaderApi, file: TUploaderFileInfo) => {
|
|
126
|
+
children: react_jsx_runtime.JSX.Element;
|
|
127
|
+
key: string;
|
|
128
|
+
onClick: () => Promise<void>;
|
|
129
|
+
};
|
|
130
|
+
declare function parseDocumentInfo(data: TDocumentInformation | null | undefined): {
|
|
131
|
+
docId: string;
|
|
132
|
+
allPoolPermission: "" | "M" | "R";
|
|
133
|
+
description: string;
|
|
134
|
+
downloadLink: string;
|
|
135
|
+
expirationDate: string;
|
|
136
|
+
metadata: _apia_uploader_controller.TDocumentMetadata[];
|
|
137
|
+
name: string;
|
|
138
|
+
permissions: {
|
|
139
|
+
pool: TDocumentPermission | TDocumentPermission[];
|
|
140
|
+
user: TDocumentPermission | TDocumentPermission[];
|
|
141
|
+
};
|
|
142
|
+
type: string;
|
|
143
|
+
versions: _apia_uploader_controller.TDocumentVersion[];
|
|
144
|
+
folderPath: string;
|
|
145
|
+
};
|
|
146
|
+
type DocumentInfo = {
|
|
147
|
+
docId: string;
|
|
148
|
+
allPoolPermission: string;
|
|
149
|
+
description: string;
|
|
150
|
+
downloadLink: string;
|
|
151
|
+
expirationDate: string;
|
|
152
|
+
metadata: any[];
|
|
153
|
+
name: string;
|
|
154
|
+
permissions: {
|
|
155
|
+
pool?: TDocumentPermission | TDocumentPermission[];
|
|
156
|
+
user?: TDocumentPermission | TDocumentPermission[];
|
|
157
|
+
};
|
|
158
|
+
type: string;
|
|
159
|
+
versions: any[];
|
|
160
|
+
folderPath: string;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
declare const InfoTable: ({ data, docId, }: {
|
|
164
|
+
data: DocumentInfo;
|
|
165
|
+
docId: string;
|
|
166
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
|
|
168
|
+
declare const PermissionsInfo: ({ data }: {
|
|
169
|
+
data: DocumentInfo;
|
|
170
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
171
|
+
|
|
172
|
+
declare const VersionTable: ({ data, api, file, }: {
|
|
173
|
+
data: Array<{
|
|
174
|
+
verUser: string;
|
|
175
|
+
verNumber: string;
|
|
176
|
+
verDate: string;
|
|
177
|
+
}>;
|
|
178
|
+
api: UploaderApi;
|
|
179
|
+
file: TUploaderFileInfo;
|
|
180
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
181
|
+
|
|
182
|
+
type TUploaderMenuItemsConditions = Partial<Record<'showEdition' | 'showLock' | 'showDownload' | 'showVersion' | 'showDelete' | 'showTranslate', boolean>>;
|
|
183
|
+
declare function getUploaderShownMenuOptions({ showDownload, showEdition, showLock, showVersion, showDelete, showTranslate, }: TUploaderMenuItemsConditions, file: TUploaderFileInfo): {
|
|
184
|
+
showEditOption: boolean;
|
|
185
|
+
showLockOption: boolean;
|
|
186
|
+
showDownloadOption: boolean;
|
|
187
|
+
showVersionOption: boolean;
|
|
188
|
+
showDeleteOption: boolean;
|
|
189
|
+
showTranslateOption: boolean;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare function openUploaderMenu(anchor: HTMLElement, uploaderApi: UploaderApi, props: TUploaderMenuItemsConditions, file: TUploaderFileInfo, langId?: string): void;
|
|
193
|
+
|
|
194
|
+
declare const UploadedFiles: (({ uploaderApi, hideDropzone, openContextMenu, }: {
|
|
195
|
+
uploaderApi: UploaderApi;
|
|
196
|
+
hideDropzone?: boolean;
|
|
197
|
+
openContextMenu?: typeof openUploaderMenu;
|
|
198
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
199
|
+
displayName: string;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export { AddFileSection, DeleteDocument, Directory, DocInfoModal, type DocumentInfo, DownloadDocument, EditDocument, FileIconRenderer, FileUploadProvider, FolderIconRenderer, InfoTable, LoadMoreRenderer, LockDocument, LockedFolderIconRenderer, MetadataTable, Permissions, PermissionsInfo, type TUploaderMenuItemsConditions, TranslateDocument, TranslateDocumentModal, UploadedFiles, UploaderContent, UploaderFileHeader, VersionDocument, VersionTable, getUploaderShownMenuOptions, makeDocTypeTooltip, openUploaderMenu, openUploaderModal, parseDocumentInfo, useFileUploadContext };
|
|
203
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|