@zjlab-fe/data-hub-ui 0.27.2 → 0.29.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/types/components/dataset-batch-action/demo/index.d.ts +1 -0
- package/dist/types/components/dataset-batch-action/index.d.ts +33 -0
- package/dist/types/components/status-tag/index.d.ts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/es/components/dataset-batch-action/index.js +107 -0
- package/es/components/dataset-batch-action/index.module.scss.js +200 -0
- package/es/components/status-tag/index.js +35 -23
- package/es/components/status-tag/index.module.scss.js +45 -0
- package/es/index.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Demo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UploadFile } from 'antd';
|
|
2
|
+
export declare enum EDatasetBatchType {
|
|
3
|
+
list = "list",
|
|
4
|
+
export = "export",
|
|
5
|
+
tag = "tag",
|
|
6
|
+
zone = "area"
|
|
7
|
+
}
|
|
8
|
+
export interface IConfirmParam {
|
|
9
|
+
type: EDatasetBatchType;
|
|
10
|
+
file?: UploadFile;
|
|
11
|
+
inputIds?: string[];
|
|
12
|
+
fields?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface IFieldOption {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
datasetCnt?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface IDatasetBatchActionParams {
|
|
20
|
+
type: EDatasetBatchType;
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
hasZoneManualInput?: boolean;
|
|
24
|
+
hasUpload?: boolean;
|
|
25
|
+
manualInputPlaceholder?: string;
|
|
26
|
+
manualInputTitle?: string;
|
|
27
|
+
fieldTitle?: string;
|
|
28
|
+
fieldOptions?: IFieldOption[];
|
|
29
|
+
}
|
|
30
|
+
export default function DatasetBatchAction(p: {
|
|
31
|
+
onCancel: () => void;
|
|
32
|
+
onConfirm: (param: IConfirmParam) => void;
|
|
33
|
+
} & IDatasetBatchActionParams): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type TagType = 'running' | 'failed' | 'success' | 'stopped' | 'pending';
|
|
3
|
+
type TagVariant = 'filled' | 'bordered' | 'dot';
|
|
3
4
|
interface IProps {
|
|
4
5
|
type?: TagType;
|
|
6
|
+
variant?: TagVariant;
|
|
7
|
+
className?: string;
|
|
5
8
|
children?: React.ReactNode;
|
|
6
9
|
}
|
|
7
10
|
export default function StatusTag(props: IProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -41,3 +41,6 @@ export type { CorpusCardProps, ProcessTemplateListItem, ProcessTemplateLabel, La
|
|
|
41
41
|
export { default as SDKModal } from './components/SDK-modal';
|
|
42
42
|
export { default as TagView } from './components/tag-view';
|
|
43
43
|
export { default as TagGroupFilter } from './components/tag-group-filter';
|
|
44
|
+
export { default as DatasetBatchAction } from './components/dataset-batch-action';
|
|
45
|
+
export type { IConfirmParam, IFieldOption, IDatasetBatchActionParams, } from './components/dataset-batch-action';
|
|
46
|
+
export { EDatasetBatchType } from './components/dataset-batch-action';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Upload, Input, Modal, Tabs, message, Alert, Button } from 'antd';
|
|
4
|
+
import { datasetBatchAction, description, manualLabel, uploadContainer, uploadIconWrapper, uploadIcon, uploadText, alertMessage, fieldSelection, fieldHeader, fieldTitleWrapper, fieldTitleIndicator, fieldTitle, fieldActions, selectAllBtn, clearAllBtn, fieldGrid, fieldItem, selected, unselected, fieldItemContent, fieldLabel, fieldCheckbox, checked, unchecked, checkIcon, fieldMeta, listTip, tipContent, tipIcon, tipText } from './index.module.scss.js';
|
|
5
|
+
|
|
6
|
+
const { Dragger } = Upload;
|
|
7
|
+
const { TextArea } = Input;
|
|
8
|
+
var EDatasetBatchType;
|
|
9
|
+
(function (EDatasetBatchType) {
|
|
10
|
+
EDatasetBatchType["list"] = "list";
|
|
11
|
+
EDatasetBatchType["export"] = "export";
|
|
12
|
+
EDatasetBatchType["tag"] = "tag";
|
|
13
|
+
EDatasetBatchType["zone"] = "area";
|
|
14
|
+
})(EDatasetBatchType || (EDatasetBatchType = {}));
|
|
15
|
+
const DATASET_FIELDS = [
|
|
16
|
+
{ id: 'id', label: '数据集ID' },
|
|
17
|
+
{ id: 'name', label: '数据集名称' },
|
|
18
|
+
{ id: 'provider', label: '提供方' },
|
|
19
|
+
{ id: 'creator', label: '发布者' },
|
|
20
|
+
{ id: 'fileSize', label: '数据量' },
|
|
21
|
+
{ id: 'authorizationType', label: '开放方式' },
|
|
22
|
+
{ id: 'subjects', label: '科学领域' },
|
|
23
|
+
{ id: 'source', label: '来源名称' },
|
|
24
|
+
{ id: 'keywords', label: '关键词' },
|
|
25
|
+
{ id: 'label', label: '相关标签' },
|
|
26
|
+
{ id: 'license', label: '使用许可' },
|
|
27
|
+
{ id: 'dataSourceUrl', label: '来源链接' },
|
|
28
|
+
{ id: 'publishTime', label: '发布时间' },
|
|
29
|
+
{ id: 'storageFilePath', label: '存储路径' },
|
|
30
|
+
{ id: 'domain', label: '域名标识' },
|
|
31
|
+
];
|
|
32
|
+
function DatasetBatchAction(p) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
const [fileList, setFileList] = React.useState([]);
|
|
35
|
+
const [manualInputValue, setManualInputValue] = React.useState('');
|
|
36
|
+
const [activeTab, setActiveTab] = React.useState(p.hasZoneManualInput ? 'manual' : 'upload');
|
|
37
|
+
const exportFields = (_a = p.fieldOptions) !== null && _a !== void 0 ? _a : (p.type === EDatasetBatchType.list || p.type === EDatasetBatchType.export ? DATASET_FIELDS : []);
|
|
38
|
+
const [selectedFields, setSelectedFields] = React.useState(new Set((exportFields === null || exportFields === void 0 ? void 0 : exportFields.map((f) => f.id)) || []));
|
|
39
|
+
const hasUpload = (_b = p.hasUpload) !== null && _b !== void 0 ? _b : true;
|
|
40
|
+
const handleConfirmExport = () => {
|
|
41
|
+
if (p.type === EDatasetBatchType.zone) {
|
|
42
|
+
if (activeTab === 'manual' && !manualInputValue.trim()) {
|
|
43
|
+
message.warning('请输入数据集ID');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (activeTab === 'upload' && !fileList.length) {
|
|
47
|
+
message.warning('请上传CSV文件');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const inputIds = activeTab === 'manual'
|
|
51
|
+
? manualInputValue
|
|
52
|
+
.split(/[,,\n]+/)
|
|
53
|
+
.map((id) => id.trim())
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
: undefined;
|
|
56
|
+
p.onConfirm({
|
|
57
|
+
type: p.type,
|
|
58
|
+
file: activeTab === 'upload' ? fileList[0] : undefined,
|
|
59
|
+
inputIds,
|
|
60
|
+
fields: Array.from(selectedFields),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else if (p.type !== EDatasetBatchType.list && !fileList.length) {
|
|
64
|
+
message.warning('请上传csv或excel文件');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
p.onConfirm({ type: p.type, file: fileList[0], fields: Array.from(selectedFields) });
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const toggleExportField = (fieldId) => {
|
|
72
|
+
const next = new Set(selectedFields);
|
|
73
|
+
if (next.has(fieldId))
|
|
74
|
+
next.delete(fieldId);
|
|
75
|
+
else
|
|
76
|
+
next.add(fieldId);
|
|
77
|
+
setSelectedFields(next);
|
|
78
|
+
};
|
|
79
|
+
return (jsxs(Modal, { title: p.title, open: true, onOk: handleConfirmExport, onCancel: p.onCancel, className: datasetBatchAction, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88", children: [jsx("p", { className: description, children: p.description }), p.type === EDatasetBatchType.zone && p.hasZoneManualInput && (jsxs(Fragment, { children: [hasUpload && (jsx(Tabs, { activeKey: activeTab, onChange: setActiveTab, items: [
|
|
80
|
+
{
|
|
81
|
+
key: 'manual',
|
|
82
|
+
label: '手动输入ID',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'upload',
|
|
86
|
+
label: '批量任务文件上传',
|
|
87
|
+
},
|
|
88
|
+
] })), activeTab === 'manual' && (jsxs("div", { children: [jsx("p", { className: manualLabel, children: p.manualInputTitle }), jsx(TextArea, { value: manualInputValue, onChange: (e) => setManualInputValue(e.target.value), placeholder: p.manualInputPlaceholder, rows: 6 })] }))] })), hasUpload &&
|
|
89
|
+
(p.type === EDatasetBatchType.export ||
|
|
90
|
+
p.type === EDatasetBatchType.tag ||
|
|
91
|
+
(p.type === EDatasetBatchType.zone && activeTab === 'upload')) && (jsxs(Dragger, { name: "name", customRequest: (options) => {
|
|
92
|
+
if (options.onSuccess) {
|
|
93
|
+
options.onSuccess({});
|
|
94
|
+
}
|
|
95
|
+
}, className: uploadContainer, multiple: false, accept: ".csv,.xlsx,.xls", fileList: fileList, onChange: (info) => {
|
|
96
|
+
const newFileList = [...info.fileList];
|
|
97
|
+
if (newFileList.length > 1) {
|
|
98
|
+
message.warning('单次任务只能上传1个文件,不支持第二个文件的上传');
|
|
99
|
+
}
|
|
100
|
+
setFileList(newFileList.slice(0, 1));
|
|
101
|
+
}, onRemove: () => setFileList([]), children: [jsx("div", { className: uploadIconWrapper, children: jsx("svg", { className: uploadIcon, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }) }), jsx("div", { className: uploadText, children: "\u70B9\u51FB\u6D4F\u89C8\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u81F3\u6B64\uFF08\u652F\u6301csv\u6216excel\u6587\u4EF6\uFF09" })] })), p.type === EDatasetBatchType.tag && (jsx(Alert, { message: "\u63D0\u793A\uFF1A\u6587\u4EF6\u7B2C\u4E00\u5217\u5E94\u4E3A dataset_id\uFF0C\u7B2C\u4E8C\u5217\u4E3A tag_ids\uFF08\u591A\u4E2A\u6807\u7B7E ID \u8BF7\u7528\u5206\u53F7\u5206\u9694\uFF09\u3002", type: "info", showIcon: true, className: alertMessage })), p.type === EDatasetBatchType.zone && activeTab === 'upload' && p.hasZoneManualInput && (jsx(Alert, { message: '\u63D0\u793A\uFF1A\u8BF7\u4E0A\u4F20csv\u6216excel\u6587\u4EF6\uFF0C\u63D0\u4F9B\u6570\u636E\u96C6id\uFF0C\u5355\u6B21\u4EFB\u52A1\u53EA\u80FD\u4E0A\u4F201\u4E2A\u6587\u4EF6\u3002\u6587\u4EF6\u91C7\u7528\u5355\u5217\u5E03\u5C40\uFF0C\u9996\u884C\u4E3A"dataset_id"\uFF0C\u4ECE\u7B2C\u4E8C\u884C\u5F00\u59CB\u6BCF\u884C\u4E3A\u4E00\u4E2A\u5177\u4F53id\u3002', type: "info", showIcon: true, className: alertMessage })), exportFields && exportFields.length > 0 && (jsxs("div", { className: fieldSelection, children: [jsxs("div", { className: fieldHeader, children: [jsxs("div", { className: fieldTitleWrapper, children: [jsx("div", { className: fieldTitleIndicator }), jsx("h4", { className: fieldTitle, children: p.fieldTitle })] }), jsxs("div", { className: fieldActions, children: [jsx("span", { onClick: () => setSelectedFields(new Set((exportFields === null || exportFields === void 0 ? void 0 : exportFields.map((f) => f.id)) || [])), className: selectAllBtn, children: "\u5168\u9009" }), jsx("span", { onClick: () => setSelectedFields(new Set()), className: clearAllBtn, children: "\u6E05\u7A7A" })] })] }), jsx("div", { className: fieldGrid, children: exportFields.map((field) => {
|
|
102
|
+
const isSelected = selectedFields.has(field.id);
|
|
103
|
+
return (jsxs(Button, { onClick: () => toggleExportField(field.id), className: `${fieldItem} ${isSelected ? selected : unselected}`, style: { height: p.type === EDatasetBatchType.zone ? '60px' : '32px' }, children: [jsxs("div", { className: fieldItemContent, children: [jsx("span", { className: fieldLabel, title: field.label, children: field.label }), jsx("div", { className: `${fieldCheckbox} ${isSelected ? checked : unchecked}`, children: isSelected && (jsx("svg", { className: checkIcon, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 4, children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) })) })] }), p.type === EDatasetBatchType.zone && (jsxs("div", { className: fieldMeta, children: [jsxs("span", { children: ["ID\uFF1A", field.id] }), jsxs("span", { children: [field.datasetCnt, " \u8D44\u4EA7"] })] }))] }, field.id));
|
|
104
|
+
}) })] })), p.type === EDatasetBatchType.list && (jsx("div", { className: listTip, children: jsxs("div", { className: tipContent, children: [jsx("svg", { className: tipIcon, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), jsx("p", { className: tipText, children: "\u8BF7\u524D\u5F80\"\u6279\u91CF\u4EFB\u52A1\"\u4E2D\u67E5\u770B\u5BFC\u51FA\u6587\u4EF6" })] }) }))] }));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { EDatasetBatchType, DatasetBatchAction as default };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
var style = document.createElement('style');
|
|
2
|
+
style.textContent = `.index-module__datasetBatchAction___L6yz5 .index-module__description___CfxF4 {
|
|
3
|
+
color: #545b64;
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
margin-top: 8px;
|
|
6
|
+
}
|
|
7
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__manualLabel___lvm5X {
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
color: #545b64;
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
margin-top: 0;
|
|
12
|
+
}
|
|
13
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__uploadContainer___j8IxU {
|
|
14
|
+
margin-top: 24px;
|
|
15
|
+
}
|
|
16
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__uploadContainer___j8IxU .index-module__uploadIconWrapper___yV1NJ {
|
|
17
|
+
width: 64px;
|
|
18
|
+
height: 64px;
|
|
19
|
+
background: #f8fafc;
|
|
20
|
+
border-radius: 16px;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
margin: 0 auto 16px auto;
|
|
25
|
+
transition: all 0.3s ease;
|
|
26
|
+
}
|
|
27
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__uploadContainer___j8IxU .index-module__uploadIconWrapper___yV1NJ .index-module__uploadIcon___1Wkwf {
|
|
28
|
+
width: 32px;
|
|
29
|
+
height: 32px;
|
|
30
|
+
color: #cbd5e1;
|
|
31
|
+
transition: color 0.3s ease;
|
|
32
|
+
}
|
|
33
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__uploadContainer___j8IxU .index-module__uploadText___x0Qvf {
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
font-weight: 900;
|
|
36
|
+
text-transform: uppercase;
|
|
37
|
+
letter-spacing: 0.1em;
|
|
38
|
+
color: #94a3b8;
|
|
39
|
+
text-align: center;
|
|
40
|
+
margin-bottom: 16px;
|
|
41
|
+
transition: color 0.3s ease;
|
|
42
|
+
}
|
|
43
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__alertMessage___ZwIzM {
|
|
44
|
+
margin-top: 16px;
|
|
45
|
+
}
|
|
46
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- {
|
|
47
|
+
margin-top: 16px;
|
|
48
|
+
margin-bottom: 32px;
|
|
49
|
+
}
|
|
50
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
}
|
|
55
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux .index-module__fieldTitleWrapper___6ojO6 {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
}
|
|
59
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux .index-module__fieldTitleWrapper___6ojO6 .index-module__fieldTitleIndicator___fhurM {
|
|
60
|
+
width: 6px;
|
|
61
|
+
height: 16px;
|
|
62
|
+
background: #1775fe;
|
|
63
|
+
border-radius: 9999px;
|
|
64
|
+
}
|
|
65
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux .index-module__fieldTitleWrapper___6ojO6 .index-module__fieldTitle___-3Ew- {
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
font-weight: 900;
|
|
68
|
+
color: #0f172b;
|
|
69
|
+
text-transform: uppercase;
|
|
70
|
+
letter-spacing: 0.1em;
|
|
71
|
+
margin-left: 8px;
|
|
72
|
+
}
|
|
73
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux .index-module__fieldActions___3QFDa {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 8px;
|
|
77
|
+
}
|
|
78
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux .index-module__fieldActions___3QFDa .index-module__selectAllBtn___vlUcC {
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
font-weight: 900;
|
|
81
|
+
color: #1775fe;
|
|
82
|
+
text-transform: uppercase;
|
|
83
|
+
letter-spacing: 0.1em;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldHeader___jDOux .index-module__fieldActions___3QFDa .index-module__clearAllBtn___ytxsA {
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
font-weight: 900;
|
|
89
|
+
color: #94a3b8;
|
|
90
|
+
text-transform: uppercase;
|
|
91
|
+
letter-spacing: 0.1em;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X {
|
|
95
|
+
display: grid;
|
|
96
|
+
grid-template-columns: repeat(2, 1fr);
|
|
97
|
+
gap: 16px;
|
|
98
|
+
margin-top: 16px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB {
|
|
102
|
+
border-radius: 16px;
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
border: 2px solid;
|
|
106
|
+
display: block;
|
|
107
|
+
transition: all 0.3s ease;
|
|
108
|
+
width: 100%;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
}
|
|
112
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB.index-module__selected___yvp-c {
|
|
113
|
+
background: #eff6ff;
|
|
114
|
+
border-color: #1775fe;
|
|
115
|
+
color: #1d4ed8;
|
|
116
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
117
|
+
}
|
|
118
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB.index-module__unselected___zpzVQ {
|
|
119
|
+
background: #ffffff;
|
|
120
|
+
color: #64748b;
|
|
121
|
+
border-color: #f1f5f9;
|
|
122
|
+
}
|
|
123
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldItemContent___CYfcn {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
width: 100%;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
}
|
|
131
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldItemContent___CYfcn .index-module__fieldLabel___ZZAbg {
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
text-overflow: ellipsis;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
flex: 1;
|
|
136
|
+
min-width: 0;
|
|
137
|
+
text-align: left;
|
|
138
|
+
max-width: calc(100% - 28px);
|
|
139
|
+
}
|
|
140
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldItemContent___CYfcn .index-module__fieldCheckbox___wu5hE {
|
|
141
|
+
width: 20px;
|
|
142
|
+
height: 20px;
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
}
|
|
149
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldItemContent___CYfcn .index-module__fieldCheckbox___wu5hE.index-module__checked___a9iwW {
|
|
150
|
+
background: #1775fe;
|
|
151
|
+
}
|
|
152
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldItemContent___CYfcn .index-module__fieldCheckbox___wu5hE.index-module__unchecked___Zr7bU {
|
|
153
|
+
background: #f1f5f9;
|
|
154
|
+
border: 1px solid #e2e8f0;
|
|
155
|
+
}
|
|
156
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldItemContent___CYfcn .index-module__fieldCheckbox___wu5hE .index-module__checkIcon___rIrgu {
|
|
157
|
+
width: 12px;
|
|
158
|
+
height: 12px;
|
|
159
|
+
color: #ffffff;
|
|
160
|
+
}
|
|
161
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__fieldSelection___ongq- .index-module__fieldGrid___p8N1X .index-module__fieldItem___ZC7EB .index-module__fieldMeta___FPhuU {
|
|
162
|
+
font-size: 12px;
|
|
163
|
+
color: #94a3b8;
|
|
164
|
+
width: 100%;
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: space-between;
|
|
168
|
+
font-weight: 400;
|
|
169
|
+
margin-top: 8px;
|
|
170
|
+
}
|
|
171
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__listTip___gu05n {
|
|
172
|
+
margin-top: 16px;
|
|
173
|
+
border-top: 1px solid #f1f5f9;
|
|
174
|
+
background: rgba(248, 250, 252, 0.5);
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-direction: column;
|
|
177
|
+
align-items: flex-end;
|
|
178
|
+
}
|
|
179
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__listTip___gu05n .index-module__tipContent___D-7Qq {
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
color: #1775fe;
|
|
183
|
+
}
|
|
184
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__listTip___gu05n .index-module__tipContent___D-7Qq .index-module__tipIcon___HpeFp {
|
|
185
|
+
width: 16px;
|
|
186
|
+
height: 16px;
|
|
187
|
+
}
|
|
188
|
+
.index-module__datasetBatchAction___L6yz5 .index-module__listTip___gu05n .index-module__tipContent___D-7Qq .index-module__tipText___LiR5M {
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
font-weight: 900;
|
|
191
|
+
text-transform: uppercase;
|
|
192
|
+
letter-spacing: 0.1em;
|
|
193
|
+
margin-left: 4px;
|
|
194
|
+
}`;
|
|
195
|
+
document.head.appendChild(style);
|
|
196
|
+
|
|
197
|
+
var datasetBatchAction = "index-module__datasetBatchAction___L6yz5";var description = "index-module__description___CfxF4";var manualLabel = "index-module__manualLabel___lvm5X";var uploadContainer = "index-module__uploadContainer___j8IxU";var uploadIconWrapper = "index-module__uploadIconWrapper___yV1NJ";var uploadIcon = "index-module__uploadIcon___1Wkwf";var uploadText = "index-module__uploadText___x0Qvf";var alertMessage = "index-module__alertMessage___ZwIzM";var fieldSelection = "index-module__fieldSelection___ongq-";var fieldHeader = "index-module__fieldHeader___jDOux";var fieldTitleWrapper = "index-module__fieldTitleWrapper___6ojO6";var fieldTitleIndicator = "index-module__fieldTitleIndicator___fhurM";var fieldTitle = "index-module__fieldTitle___-3Ew-";var fieldActions = "index-module__fieldActions___3QFDa";var selectAllBtn = "index-module__selectAllBtn___vlUcC";var clearAllBtn = "index-module__clearAllBtn___ytxsA";var fieldGrid = "index-module__fieldGrid___p8N1X";var fieldItem = "index-module__fieldItem___ZC7EB";var selected = "index-module__selected___yvp-c";var unselected = "index-module__unselected___zpzVQ";var fieldItemContent = "index-module__fieldItemContent___CYfcn";var fieldLabel = "index-module__fieldLabel___ZZAbg";var fieldCheckbox = "index-module__fieldCheckbox___wu5hE";var checked = "index-module__checked___a9iwW";var unchecked = "index-module__unchecked___Zr7bU";var checkIcon = "index-module__checkIcon___rIrgu";var fieldMeta = "index-module__fieldMeta___FPhuU";var listTip = "index-module__listTip___gu05n";var tipContent = "index-module__tipContent___D-7Qq";var tipIcon = "index-module__tipIcon___HpeFp";var tipText = "index-module__tipText___LiR5M";
|
|
198
|
+
var styles = {"datasetBatchAction":"index-module__datasetBatchAction___L6yz5","description":"index-module__description___CfxF4","manualLabel":"index-module__manualLabel___lvm5X","uploadContainer":"index-module__uploadContainer___j8IxU","uploadIconWrapper":"index-module__uploadIconWrapper___yV1NJ","uploadIcon":"index-module__uploadIcon___1Wkwf","uploadText":"index-module__uploadText___x0Qvf","alertMessage":"index-module__alertMessage___ZwIzM","fieldSelection":"index-module__fieldSelection___ongq-","fieldHeader":"index-module__fieldHeader___jDOux","fieldTitleWrapper":"index-module__fieldTitleWrapper___6ojO6","fieldTitleIndicator":"index-module__fieldTitleIndicator___fhurM","fieldTitle":"index-module__fieldTitle___-3Ew-","fieldActions":"index-module__fieldActions___3QFDa","selectAllBtn":"index-module__selectAllBtn___vlUcC","clearAllBtn":"index-module__clearAllBtn___ytxsA","fieldGrid":"index-module__fieldGrid___p8N1X","fieldItem":"index-module__fieldItem___ZC7EB","selected":"index-module__selected___yvp-c","unselected":"index-module__unselected___zpzVQ","fieldItemContent":"index-module__fieldItemContent___CYfcn","fieldLabel":"index-module__fieldLabel___ZZAbg","fieldCheckbox":"index-module__fieldCheckbox___wu5hE","checked":"index-module__checked___a9iwW","unchecked":"index-module__unchecked___Zr7bU","checkIcon":"index-module__checkIcon___rIrgu","fieldMeta":"index-module__fieldMeta___FPhuU","listTip":"index-module__listTip___gu05n","tipContent":"index-module__tipContent___D-7Qq","tipIcon":"index-module__tipIcon___HpeFp","tipText":"index-module__tipText___LiR5M"};
|
|
199
|
+
|
|
200
|
+
export { alertMessage, checkIcon, checked, clearAllBtn, datasetBatchAction, styles as default, description, fieldActions, fieldCheckbox, fieldGrid, fieldHeader, fieldItem, fieldItemContent, fieldLabel, fieldMeta, fieldSelection, fieldTitle, fieldTitleIndicator, fieldTitleWrapper, listTip, manualLabel, selectAllBtn, selected, tipContent, tipIcon, tipText, unchecked, unselected, uploadContainer, uploadIcon, uploadIconWrapper, uploadText };
|
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Tag } from 'antd';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import * as index_module from './index.module.scss.js';
|
|
5
|
+
import { statusDot, statusTag, dot } from './index.module.scss.js';
|
|
3
6
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const statusStyles = {
|
|
8
|
+
filled: {
|
|
9
|
+
running: { color: '#1775fe', backgroundColor: 'rgba(23, 117, 254, 0.1)' },
|
|
10
|
+
failed: { color: '#ff4d4f', backgroundColor: 'rgba(255, 77, 79, 0.1)' },
|
|
11
|
+
success: { color: '#52c41a', backgroundColor: 'rgba(82, 196, 26, 0.1)' },
|
|
12
|
+
stopped: { color: '#545b64', backgroundColor: '#edf2fc' },
|
|
13
|
+
pending: { color: '#fa8c16', backgroundColor: 'rgba(250, 140, 22, 0.1)' },
|
|
14
|
+
},
|
|
15
|
+
dot: {
|
|
16
|
+
running: { color: '#1775fe', dotColor: '#1775fe' },
|
|
17
|
+
failed: { color: '#ff4d4f', dotColor: '#ff4d4f' },
|
|
18
|
+
success: { color: '#52c41a', dotColor: '#52c41a' },
|
|
19
|
+
stopped: { color: 'rgba(0, 0, 0, 0.65)', dotColor: '#d9d9d9' },
|
|
20
|
+
pending: { color: '#fa8c16', dotColor: '#fa8c16' },
|
|
21
|
+
},
|
|
22
|
+
bordered: {
|
|
23
|
+
running: { color: '#1775fe', backgroundColor: '#ecf4ff', borderColor: '#b3d2ff' },
|
|
24
|
+
failed: { color: '#f5222d', backgroundColor: '#fff1f0', borderColor: '#ffa39e' },
|
|
25
|
+
success: { color: '#52c41a', backgroundColor: '#f6ffed', borderColor: '#b7eb8f' },
|
|
26
|
+
stopped: { color: 'rgba(0, 0, 0, 0.25)', backgroundColor: '#f5f5f5', borderColor: '#d9d9d9' },
|
|
27
|
+
pending: { color: '#fa8c16', backgroundColor: '#fff7e6', borderColor: '#fa8c16' },
|
|
28
|
+
},
|
|
10
29
|
};
|
|
11
30
|
function StatusTag(props) {
|
|
12
|
-
const { type = 'running', children } = props;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (jsx(Tag, { bordered: false, style: {
|
|
22
|
-
backgroundColor: `rgba(${hexToRgb(colors)},0.1)`,
|
|
23
|
-
borderRadius: '4px',
|
|
24
|
-
fontSize: '14px',
|
|
25
|
-
color: `${colors}`,
|
|
26
|
-
padding: '3px 8px',
|
|
27
|
-
fontFamily: 'AlibabaPuHuiTi-3-55-RegularL3',
|
|
31
|
+
const { type = 'running', variant = 'filled', className, children } = props;
|
|
32
|
+
const preset = statusStyles[variant][type];
|
|
33
|
+
if (variant === 'dot') {
|
|
34
|
+
return (jsxs("span", { className: classNames(statusTag, dot, className), children: [jsx("span", { className: statusDot, style: { backgroundColor: preset.dotColor } }), jsx("span", { style: { color: preset.color }, children: children })] }));
|
|
35
|
+
}
|
|
36
|
+
return (jsx(Tag, { bordered: variant === 'bordered', className: classNames(statusTag, index_module[variant], className), style: {
|
|
37
|
+
color: preset.color,
|
|
38
|
+
backgroundColor: preset.backgroundColor,
|
|
39
|
+
borderColor: preset.borderColor,
|
|
28
40
|
}, children: children }));
|
|
29
41
|
}
|
|
30
42
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var style = document.createElement('style');
|
|
2
|
+
style.textContent = `.index-module__statusTag___yRGEa {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
margin-inline-end: 0;
|
|
6
|
+
font-family: "AlibabaPuHuiTi-3-55-RegularL3", "PingFang SC", sans-serif;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.index-module__filled___SKjTo {
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
padding: 1px 8px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
line-height: 16px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.index-module__bordered___x7xGX {
|
|
18
|
+
border-radius: 2px;
|
|
19
|
+
padding: 0 8px;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
line-height: 20px;
|
|
22
|
+
border-width: 1px;
|
|
23
|
+
border-style: solid;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.index-module__dot___rbWrB {
|
|
27
|
+
gap: 8px;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
line-height: 22px;
|
|
30
|
+
padding: 0;
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.index-module__statusDot___yMpG3 {
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
width: 6px;
|
|
37
|
+
height: 6px;
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
}`;
|
|
40
|
+
document.head.appendChild(style);
|
|
41
|
+
|
|
42
|
+
var statusTag = "index-module__statusTag___yRGEa";var filled = "index-module__filled___SKjTo";var bordered = "index-module__bordered___x7xGX";var dot = "index-module__dot___rbWrB";var statusDot = "index-module__statusDot___yMpG3";
|
|
43
|
+
var styles = {"statusTag":"index-module__statusTag___yRGEa","filled":"index-module__filled___SKjTo","bordered":"index-module__bordered___x7xGX","dot":"index-module__dot___rbWrB","statusDot":"index-module__statusDot___yMpG3"};
|
|
44
|
+
|
|
45
|
+
export { bordered, styles as default, dot, filled, statusDot, statusTag };
|
package/es/index.js
CHANGED
|
@@ -36,4 +36,5 @@ export { default as ModelCard } from './components/model-card/index.js';
|
|
|
36
36
|
export { default as SDKModal } from './components/SDK-modal/index.js';
|
|
37
37
|
export { default as TagView } from './components/tag-view/index.js';
|
|
38
38
|
export { default as TagGroupFilter } from './components/tag-group-filter/index.js';
|
|
39
|
+
export { default as DatasetBatchAction, EDatasetBatchType } from './components/dataset-batch-action/index.js';
|
|
39
40
|
export { default as UploadDrawerUploadStoreProvider } from './components/uploadDrawer/UploadStoreProvider.js';
|