@zjlab-fe/data-hub-ui 0.2.2 → 0.2.4
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/README.md +42 -42
- package/dist/types/components/FileUploader/FileUploadModal.d.ts +1 -0
- package/dist/types/components/FileUploader/FileUploaderFileDragger.d.ts +3 -1
- package/dist/types/components/FileUploader/UploadStoreProvider.d.ts +6 -1
- package/dist/types/components/FileUploader/demo/index.d.ts +1 -0
- package/dist/types/components/FileUploader/hooks/useResumeUnfinishedUploads.d.ts +0 -2
- package/dist/types/components/FileUploader/hooks/useTranslate.d.ts +1 -0
- package/dist/types/components/FileUploader/translations.d.ts +4 -0
- package/dist/types/components/FileUploader/utils/modalConfig.d.ts +3 -0
- package/dist/types/components/bench-card/demo/index.d.ts +1 -0
- package/dist/types/components/bench-card/index.d.ts +9 -0
- package/dist/types/components/copy/index.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/es/index.js +1 -1
- package/jest.config.js +10 -10
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/postcss.config.js +7 -7
- package/tailwind.config.js +49 -49
- package/webpack.common.js +54 -54
- package/dist/types/demo/layout/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
## data-hub-ui
|
|
2
|
-
|
|
3
|
-
### 使用
|
|
4
|
-
|
|
5
|
-
`import { InputTag } from '@zjlab-fe/data-hub-ui`
|
|
6
|
-
|
|
7
|
-
### 组件文档站点
|
|
8
|
-
|
|
9
|
-
https://shelwinjue.github.io/fe-assets/data-hub-ui/doc
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### 新建组件
|
|
14
|
-
|
|
15
|
-
在`src/components`目录下新建组件目录,参考组件`input-tag`的代码目录
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
component-folder
|
|
19
|
-
├── demo // 确保是demo目录
|
|
20
|
-
│ └── index.tsx // demo调试入口文件
|
|
21
|
-
│
|
|
22
|
-
├── index.module.scss // 组件的样式文件,使用css modules
|
|
23
|
-
├── index.tsx // 组件入口文件
|
|
24
|
-
└── README.md // 组件的说明文档,用于生成组件文档站点
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 增加组件demo路由
|
|
28
|
-
|
|
29
|
-
为了调试组件,需要在`src/demo/router/index.tsx`中增加组件demo的路由配置
|
|
30
|
-
|
|
31
|
-
### 组件库本地开发&调试
|
|
32
|
-
|
|
33
|
-
`npm run start`
|
|
34
|
-
|
|
35
|
-
### 组件README.md说明
|
|
36
|
-
|
|
37
|
-
请在README.md中引入demo,用于代码演示,补充完整的API说明,可参考`src/components/input-tag/README.md`
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
## data-hub-ui
|
|
2
|
+
|
|
3
|
+
### 使用
|
|
4
|
+
|
|
5
|
+
`import { InputTag } from '@zjlab-fe/data-hub-ui`
|
|
6
|
+
|
|
7
|
+
### 组件文档站点
|
|
8
|
+
|
|
9
|
+
https://shelwinjue.github.io/fe-assets/data-hub-ui/doc
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 新建组件
|
|
14
|
+
|
|
15
|
+
在`src/components`目录下新建组件目录,参考组件`input-tag`的代码目录
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
component-folder
|
|
19
|
+
├── demo // 确保是demo目录
|
|
20
|
+
│ └── index.tsx // demo调试入口文件
|
|
21
|
+
│
|
|
22
|
+
├── index.module.scss // 组件的样式文件,使用css modules
|
|
23
|
+
├── index.tsx // 组件入口文件
|
|
24
|
+
└── README.md // 组件的说明文档,用于生成组件文档站点
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 增加组件demo路由
|
|
28
|
+
|
|
29
|
+
为了调试组件,需要在`src/demo/router/index.tsx`中增加组件demo的路由配置
|
|
30
|
+
|
|
31
|
+
### 组件库本地开发&调试
|
|
32
|
+
|
|
33
|
+
`npm run start`
|
|
34
|
+
|
|
35
|
+
### 组件README.md说明
|
|
36
|
+
|
|
37
|
+
请在README.md中引入demo,用于代码演示,补充完整的API说明,可参考`src/components/input-tag/README.md`
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import './FileUploaderFileDragger.css';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
export interface FileDraggerProps {
|
|
3
4
|
accept?: string;
|
|
4
5
|
directory?: boolean;
|
|
5
6
|
dragAreaDescription?: ReactNode;
|
|
6
7
|
maxSizePerFile?: number;
|
|
8
|
+
className?: string;
|
|
7
9
|
onFileReceived: (_files: File[]) => void;
|
|
8
10
|
}
|
|
9
|
-
export default function FileUploaderFileDragger({ accept, directory, dragAreaDescription, maxSizePerFile, onFileReceived, }: FileDraggerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default function FileUploaderFileDragger({ className, accept, directory, dragAreaDescription, maxSizePerFile, onFileReceived, }: FileDraggerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UploadableFile } from './types';
|
|
3
|
+
import { Locale } from './translations';
|
|
3
4
|
export type UploadStore = {
|
|
4
5
|
[key: string]: UploadableFile[];
|
|
5
6
|
};
|
|
@@ -27,10 +28,14 @@ type UploadStoreAction = {
|
|
|
27
28
|
files: UploadableFile[];
|
|
28
29
|
};
|
|
29
30
|
type UploadStoreDispatch = React.Dispatch<UploadStoreAction>;
|
|
31
|
+
export declare const localeAtom: import("jotai").PrimitiveAtom<Locale> & {
|
|
32
|
+
init: Locale;
|
|
33
|
+
};
|
|
30
34
|
export declare const TEMP_STORE: {};
|
|
31
35
|
export declare const UploadStoreContext: React.Context<UploadStore>;
|
|
32
36
|
export declare const UploadStoreDispatchContext: React.Context<UploadStoreDispatch>;
|
|
33
|
-
export default function UploadStoreProvider({ children }: {
|
|
37
|
+
export default function UploadStoreProvider({ locale, children, }: {
|
|
38
|
+
locale?: 'zh' | 'en';
|
|
34
39
|
children: React.ReactElement;
|
|
35
40
|
}): import("react/jsx-runtime").JSX.Element;
|
|
36
41
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTranslate(): (key: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Demo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
type: 'workflow' | 'component';
|
|
3
|
+
size?: 'small' | 'middle';
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function Tcard(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Wcard(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function BenchCard(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export interface ICopy {
|
|
|
5
5
|
text?: string;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
/** 语言,默认:zh */
|
|
8
|
-
|
|
8
|
+
locale?: 'zh' | 'en';
|
|
9
9
|
}
|
|
10
10
|
export default function Copy(props: ICopy): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
/**
|
|
@@ -13,9 +13,9 @@ export default function Copy(props: ICopy): import("react/jsx-runtime").JSX.Elem
|
|
|
13
13
|
* @param text {string} 文本内容
|
|
14
14
|
* @param options {object} 其它选项
|
|
15
15
|
* @param options.showFeedback {boolean} 是否展示复制成功的反馈信息,默认展示
|
|
16
|
-
* @param options.
|
|
16
|
+
* @param options.locale {string} 语言,默认:zh
|
|
17
17
|
*/
|
|
18
18
|
export declare function copy(text: string, options?: {
|
|
19
19
|
showFeedback?: boolean;
|
|
20
|
-
|
|
20
|
+
locale?: 'zh' | 'en';
|
|
21
21
|
}): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export { default as Copy, copy } from './components/copy';
|
|
|
11
11
|
export type { ICopy } from './components/copy';
|
|
12
12
|
export { default as ConfirmAgain } from './components/confirm-again';
|
|
13
13
|
export { default as FloatingLayer } from './components/floating-layer';
|
|
14
|
+
export { default as BenchCard } from './components/bench-card';
|
|
14
15
|
export type { IFilePreviewProps } from './components/file-preview/interface';
|