@zjlab-fe/data-hub-ui 0.29.0 → 0.30.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/README.md CHANGED
@@ -12,7 +12,7 @@ https://haina-datahub.zero2x.org/data-hub-ui/doc
12
12
 
13
13
  ### 新建组件
14
14
 
15
- 在`src/components`目录下新建组件目录,参考组件`input-tag`的代码目录
15
+ 使用`npm run init`创建组件,输入组件名后,脚本会在`src/components`目录下新建组件目录,参考组件`input-tag`的代码目录
16
16
 
17
17
  ```
18
18
  component-folder
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Demo: React.FC;
3
+ export default Demo;
@@ -0,0 +1,9 @@
1
+ export interface LimitCreditModalProps {
2
+ open?: boolean;
3
+ onCancel?: () => void;
4
+ }
5
+ declare const LimitCreditModal: {
6
+ (props: LimitCreditModalProps): import("react/jsx-runtime").JSX.Element;
7
+ open(): void;
8
+ };
9
+ export default LimitCreditModal;
@@ -41,6 +41,8 @@ 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 LimitCreditModal } from './components/limit-credit-modal';
45
+ export type { LimitCreditModalProps } from './components/limit-credit-modal';
44
46
  export { default as DatasetBatchAction } from './components/dataset-batch-action';
45
47
  export type { IConfirmParam, IFieldOption, IDatasetBatchActionParams, } from './components/dataset-batch-action';
46
48
  export { EDatasetBatchType } from './components/dataset-batch-action';
@@ -0,0 +1,36 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { Modal, Space, Button } from 'antd';
3
+ import { isPublicNetwork } from '@zjlab-fe/util';
4
+ import { createRoot } from 'react-dom/client';
5
+
6
+ const LimitCreditModal = (props) => {
7
+ const isPublic = isPublicNetwork();
8
+ const handleOk = () => {
9
+ if (isPublic) {
10
+ window.open('https://alidocs.dingtalk.com/notable/share/form/v018oLl952Q1vXkzlap_dv19yqvsgs3oebp3pcjys_1qX0QQ0?source=link');
11
+ }
12
+ else {
13
+ window.open('https://alidocs.dingtalk.com/notable/share/form/v011X3lE5jKezRB4lJb_dv19yqvsgs3oebp3pcjys_1qX0QQ0?source=link');
14
+ }
15
+ };
16
+ return (jsx(Modal, Object.assign({}, props, {
17
+ // classNames={{
18
+ // content: 'modal-content-layout',
19
+ // header: 'modal-title-font modal-title-layout',
20
+ // body: 'modal-content-font modal-body-layout',
21
+ // footer: 'modal-footer-layout',
22
+ // }}
23
+ title: jsx("div", { style: { textAlign: 'center', width: '100%' }, children: "\u63D0\u793A" }), footer: jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: jsxs(Space, { children: [jsx(Button, { onClick: props.onCancel, children: "\u53D6\u6D88" }), jsx(Button, { type: "primary", onClick: handleOk, children: "\u7533\u8BF7" })] }) }), children: jsx("div", { className: "modal-content-font", style: { textAlign: 'center' }, children: "\u989D\u5EA6\u5DF2\u7528\u5C3D\uFF0C\u8BF7\u70B9\u51FB\u7533\u8BF7\u3002" }) })));
24
+ };
25
+ LimitCreditModal.open = () => {
26
+ const div = document.createElement('div');
27
+ document.body.appendChild(div);
28
+ const root = createRoot(div);
29
+ const destroy = () => {
30
+ root.unmount();
31
+ div.remove();
32
+ };
33
+ root.render(jsx(LimitCreditModal, { open: true, onCancel: destroy }));
34
+ };
35
+
36
+ export { LimitCreditModal as default };
@@ -0,0 +1,9 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import useStyle from './index.scss.js';
3
+
4
+ useStyle();
5
+ const TestComponent = (props) => {
6
+ return (jsxs("div", { className: "data-hub-ui-test-component-container", children: ["TestComponent Component", jsx("div", { children: "This is template, please delete it after you create your component." })] }));
7
+ };
8
+
9
+ export { TestComponent as default };
@@ -0,0 +1,7 @@
1
+ function useStyle() {
2
+ var style = document.createElement('style');
3
+ style.textContent = ``;
4
+ document.head.appendChild(style);
5
+ }
6
+
7
+ export { useStyle as default };
package/es/index.js CHANGED
@@ -36,5 +36,6 @@ 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 LimitCreditModal } from './components/limit-credit-modal/index.js';
39
40
  export { default as DatasetBatchAction, EDatasetBatchType } from './components/dataset-batch-action/index.js';
40
41
  export { default as UploadDrawerUploadStoreProvider } from './components/uploadDrawer/UploadStoreProvider.js';