@bioturing/components 0.15.0 → 0.15.1
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/components/Badge/component.js +21 -0
- package/dist/components/Badge/component.js.map +1 -0
- package/dist/components/Badge/style.css +1 -0
- package/dist/components/Breadcrumb/component.js +46 -0
- package/dist/components/Breadcrumb/component.js.map +1 -0
- package/dist/components/Breadcrumb/style.css +1 -0
- package/dist/components/Breadcrumb/useItemRender.js +27 -0
- package/dist/components/Breadcrumb/useItemRender.js.map +1 -0
- package/dist/components/Button/component.js +9 -0
- package/dist/components/Button/component.js.map +1 -0
- package/dist/components/Button/style.css +1 -0
- package/dist/components/Checkbox/component.js +11 -0
- package/dist/components/Checkbox/component.js.map +1 -0
- package/dist/components/Checkbox/style.css +1 -0
- package/dist/components/CodeBlock/component.js +127 -0
- package/dist/components/CodeBlock/component.js.map +1 -0
- package/dist/components/CodeBlock/style.css +1 -0
- package/dist/components/DSRoot/component.js +21 -0
- package/dist/components/DSRoot/component.js.map +1 -0
- package/dist/components/DSRoot/context.js +9 -0
- package/dist/components/DSRoot/context.js.map +1 -0
- package/dist/components/DSRoot/style.css +1 -0
- package/dist/components/DropdownMenu/component.js +103 -0
- package/dist/components/DropdownMenu/component.js.map +1 -0
- package/dist/components/DropdownMenu/style.css +1 -0
- package/dist/components/Empty/component.js +48 -0
- package/dist/components/Empty/component.js.map +1 -0
- package/dist/components/Empty/style.css +1 -0
- package/dist/components/Field/component.js +30 -0
- package/dist/components/Field/component.js.map +1 -0
- package/dist/components/Field/style.css +1 -0
- package/dist/components/Form/component.js +23 -0
- package/dist/components/Form/component.js.map +1 -0
- package/dist/components/Form/item.js +30 -0
- package/dist/components/Form/item.js.map +1 -0
- package/dist/components/Form/style.css +1 -0
- package/dist/components/IconButton/component.js +49 -0
- package/dist/components/IconButton/component.js.map +1 -0
- package/dist/components/IconButton/style.css +1 -0
- package/dist/components/Input/component.js +25 -0
- package/dist/components/Input/component.js.map +1 -0
- package/dist/components/Modal/Modal.js +161 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/ModalProvider.js +70 -0
- package/dist/components/Modal/ModalProvider.js.map +1 -0
- package/dist/components/Modal/ModalService.js +25 -0
- package/dist/components/Modal/ModalService.js.map +1 -0
- package/dist/components/Modal/constants.js +5 -0
- package/dist/components/Modal/constants.js.map +1 -0
- package/dist/components/Modal/functions.js +27 -0
- package/dist/components/Modal/functions.js.map +1 -0
- package/dist/components/Modal/index.js +20 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/Modal/style.css +1 -0
- package/dist/components/Popover/component.js +12 -0
- package/dist/components/Popover/component.js.map +1 -0
- package/dist/components/PopupPanel/component.js +190 -0
- package/dist/components/PopupPanel/component.js.map +1 -0
- package/dist/components/PopupPanel/constants.js +5 -0
- package/dist/components/PopupPanel/constants.js.map +1 -0
- package/dist/components/PopupPanel/style.css +1 -0
- package/dist/components/Radio/component.js +22 -0
- package/dist/components/Radio/component.js.map +1 -0
- package/dist/components/Radio/style.css +1 -0
- package/dist/components/ScrollArea/component.js +40 -0
- package/dist/components/ScrollArea/component.js.map +1 -0
- package/dist/components/ScrollArea/style.css +1 -0
- package/dist/components/Segmented/component.js +9 -0
- package/dist/components/Segmented/component.js.map +1 -0
- package/dist/components/Segmented/style.css +1 -0
- package/dist/components/Select/component.js +135 -0
- package/dist/components/Select/component.js.map +1 -0
- package/dist/components/Select/style.css +1 -0
- package/dist/components/Slider/component.js +23 -0
- package/dist/components/Slider/component.js.map +1 -0
- package/dist/components/Spin/component.js +12 -0
- package/dist/components/Spin/component.js.map +1 -0
- package/dist/components/Spin/style.css +1 -0
- package/dist/components/Splitter/component.js +40 -0
- package/dist/components/Splitter/component.js.map +1 -0
- package/dist/components/Splitter/style.css +1 -0
- package/dist/components/Stack/Stack.js +37 -0
- package/dist/components/Stack/Stack.js.map +1 -0
- package/dist/components/Stack/StackChild.js +57 -0
- package/dist/components/Stack/StackChild.js.map +1 -0
- package/dist/components/Stack/index.js +9 -0
- package/dist/components/Stack/index.js.map +1 -0
- package/dist/components/Stack/style.css +1 -0
- package/dist/components/Switch/component.js +9 -0
- package/dist/components/Switch/component.js.map +1 -0
- package/dist/components/Switch/style.css +1 -0
- package/dist/components/Table/component.js +68 -0
- package/dist/components/Table/component.js.map +1 -0
- package/dist/components/Table/style.css +1 -0
- package/dist/components/Tag/component.js +30 -0
- package/dist/components/Tag/component.js.map +1 -0
- package/dist/components/Tag/style.css +1 -0
- package/dist/components/ThemeProvider/component.js +41 -0
- package/dist/components/ThemeProvider/component.js.map +1 -0
- package/dist/components/ThemeProvider/style.css +1 -0
- package/dist/components/Toast/component.js +101 -0
- package/dist/components/Toast/component.js.map +1 -0
- package/dist/components/Toast/function.js +25 -0
- package/dist/components/Toast/function.js.map +1 -0
- package/dist/components/Toast/style.css +1 -0
- package/dist/components/Tooltip/component.js +26 -0
- package/dist/components/Tooltip/component.js.map +1 -0
- package/dist/components/Tooltip/style.css +1 -0
- package/dist/components/Tour/component.js +35 -0
- package/dist/components/Tour/component.js.map +1 -0
- package/dist/components/Tour/style.css +1 -0
- package/dist/components/Transition/component.js +44 -0
- package/dist/components/Transition/component.js.map +1 -0
- package/dist/components/Tree/components.js +67 -0
- package/dist/components/Tree/components.js.map +1 -0
- package/dist/components/Tree/helpers.js +53 -0
- package/dist/components/Tree/helpers.js.map +1 -0
- package/dist/components/Tree/useTreeCommon.js +86 -0
- package/dist/components/Tree/useTreeCommon.js.map +1 -0
- package/dist/components/Tree/useUniqueKeysTree.js +142 -0
- package/dist/components/Tree/useUniqueKeysTree.js.map +1 -0
- package/dist/components/Truncate/component.js +93 -0
- package/dist/components/Truncate/component.js.map +1 -0
- package/dist/components/Truncate/helpers.js +36 -0
- package/dist/components/Truncate/helpers.js.map +1 -0
- package/dist/components/Truncate/style.css +1 -0
- package/dist/components/Upload/component.js +39 -0
- package/dist/components/Upload/component.js.map +1 -0
- package/dist/components/Upload/dragger.js +23 -0
- package/dist/components/Upload/dragger.js.map +1 -0
- package/dist/components/Upload/hooks.js +18 -0
- package/dist/components/Upload/hooks.js.map +1 -0
- package/dist/components/Upload/item.js +84 -0
- package/dist/components/Upload/item.js.map +1 -0
- package/dist/components/Upload/utils.js +7 -0
- package/dist/components/Upload/utils.js.map +1 -0
- package/dist/components/VerticalCollapsiblePanel/component.js +125 -0
- package/dist/components/VerticalCollapsiblePanel/component.js.map +1 -0
- package/dist/components/VerticalCollapsiblePanel/style.css +1 -0
- package/dist/components/hooks/antd.js +22 -0
- package/dist/components/hooks/antd.js.map +1 -0
- package/dist/components/hooks/base-ui.js +47 -0
- package/dist/components/hooks/base-ui.js.map +1 -0
- package/dist/components/hooks/useCharts.js +28 -0
- package/dist/components/hooks/useCharts.js.map +1 -0
- package/dist/components/hooks/useControlledState.js +15 -0
- package/dist/components/hooks/useControlledState.js.map +1 -0
- package/dist/components/utils/WithAntdTokens.js +24 -0
- package/dist/components/utils/WithAntdTokens.js.map +1 -0
- package/dist/components/utils/antdUtils.js +58 -0
- package/dist/components/utils/antdUtils.js.map +1 -0
- package/dist/components/utils/cn.js +27 -0
- package/dist/components/utils/cn.js.map +1 -0
- package/dist/components/utils/isTracebackError.js +10 -0
- package/dist/components/utils/isTracebackError.js.map +1 -0
- package/dist/components/utils/reactToString.js +23 -0
- package/dist/components/utils/reactToString.js.map +1 -0
- package/dist/index.d.ts +2497 -3
- package/dist/index.js +188 -4004
- package/dist/index.js.map +1 -0
- package/dist/metadata.js +513 -0
- package/dist/metadata.js.map +1 -0
- package/dist/tailwind.css +1 -121
- package/dist/tailwind.d.ts +1 -0
- package/dist/tokens/and-theme/tokens.js +351 -0
- package/dist/tokens/and-theme/tokens.js.map +1 -0
- package/dist/tokens/charts/index.js +18 -0
- package/dist/tokens/charts/index.js.map +1 -0
- package/dist/tokens/charts/tokens.js +208 -0
- package/dist/tokens/charts/tokens.js.map +1 -0
- package/dist/tokens/utils.js +37 -0
- package/dist/tokens/utils.js.map +1 -0
- package/package.json +10 -108
- package/dist/Badge.css +0 -6
- package/dist/Badge.js +0 -41
- package/dist/Breadcrumb.css +0 -83
- package/dist/Breadcrumb.js +0 -92
- package/dist/Checkbox.css +0 -13
- package/dist/Checkbox.js +0 -12
- package/dist/CodeBlock.css +0 -213
- package/dist/CodeBlock.js +0 -644
- package/dist/Collapse.css +0 -21
- package/dist/Collapse.js +0 -49
- package/dist/DSRoot.css +0 -667
- package/dist/DSRoot.js +0 -1428
- package/dist/DropdownMenu.css +0 -95
- package/dist/DropdownMenu.js +0 -211
- package/dist/Empty.css +0 -19
- package/dist/Empty.js +0 -53
- package/dist/Field.css +0 -14
- package/dist/Field.js +0 -66
- package/dist/Form.css +0 -64
- package/dist/Form.js +0 -125
- package/dist/IconButton.css +0 -52
- package/dist/IconButton.js +0 -82
- package/dist/Input.js +0 -48
- package/dist/Modal.css +0 -317
- package/dist/Modal.js +0 -677
- package/dist/Popover.js +0 -10
- package/dist/PopupPanel.css +0 -170
- package/dist/PopupPanel.js +0 -333
- package/dist/Radio.css +0 -14
- package/dist/Radio.js +0 -24
- package/dist/ScrollArea.css +0 -64
- package/dist/ScrollArea.js +0 -50
- package/dist/Segmented.css +0 -16
- package/dist/Segmented.js +0 -10
- package/dist/Select.css +0 -24
- package/dist/Select.js +0 -157
- package/dist/Slider.js +0 -39
- package/dist/Spin.css +0 -36
- package/dist/Spin.js +0 -33
- package/dist/Splitter.css +0 -6
- package/dist/Splitter.js +0 -47
- package/dist/Switch.css +0 -7
- package/dist/Switch.js +0 -10
- package/dist/Table.css +0 -116
- package/dist/Table.js +0 -126
- package/dist/Tag.css +0 -17
- package/dist/Tag.js +0 -24
- package/dist/ThemeProvider.css +0 -39
- package/dist/ThemeProvider.js +0 -403
- package/dist/Toast.css +0 -622
- package/dist/Toast.js +0 -1401
- package/dist/Tooltip.css +0 -6
- package/dist/Tooltip.js +0 -36
- package/dist/Tour.css +0 -73
- package/dist/Tour.js +0 -54
- package/dist/Tree.js +0 -318
- package/dist/Truncate.css +0 -31
- package/dist/Truncate.js +0 -216
- package/dist/Upload.css +0 -144
- package/dist/Upload.js +0 -516
- package/dist/VerticalCollapsiblePanel.css +0 -193
- package/dist/VerticalCollapsiblePanel.js +0 -469
- package/dist/components/Badge/component.d.ts +0 -4
- package/dist/components/Badge/index.d.ts +0 -1
- package/dist/components/Breadcrumb/component.d.ts +0 -6
- package/dist/components/Breadcrumb/index.d.ts +0 -2
- package/dist/components/Breadcrumb/types.d.ts +0 -18
- package/dist/components/Breadcrumb/useItemRender.d.ts +0 -6
- package/dist/components/Button/component.d.ts +0 -8
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/component.d.ts +0 -11
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CodeBlock/component.d.ts +0 -3
- package/dist/components/CodeBlock/index.d.ts +0 -2
- package/dist/components/CodeBlock/types.d.ts +0 -59
- package/dist/components/Collapse/component.d.ts +0 -14
- package/dist/components/Collapse/index.d.ts +0 -1
- package/dist/components/DSRoot/component.d.ts +0 -14
- package/dist/components/DSRoot/context.d.ts +0 -7
- package/dist/components/DSRoot/index.d.ts +0 -1
- package/dist/components/DropdownMenu/component.d.ts +0 -31
- package/dist/components/DropdownMenu/index.d.ts +0 -2
- package/dist/components/Empty/component.d.ts +0 -13
- package/dist/components/Empty/index.d.ts +0 -1
- package/dist/components/Field/component.d.ts +0 -42
- package/dist/components/Field/index.d.ts +0 -1
- package/dist/components/Form/component.d.ts +0 -19
- package/dist/components/Form/index.d.ts +0 -1
- package/dist/components/Form/item.d.ts +0 -5
- package/dist/components/IconButton/component.d.ts +0 -30
- package/dist/components/IconButton/index.d.ts +0 -1
- package/dist/components/Input/component.d.ts +0 -30
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -84
- package/dist/components/Modal/ModalProvider.d.ts +0 -5
- package/dist/components/Modal/ModalService.d.ts +0 -33
- package/dist/components/Modal/constants.d.ts +0 -9
- package/dist/components/Modal/functions.d.ts +0 -27
- package/dist/components/Modal/index.d.ts +0 -15
- package/dist/components/Popover/component.d.ts +0 -9
- package/dist/components/Popover/index.d.ts +0 -1
- package/dist/components/PopupPanel/component.d.ts +0 -61
- package/dist/components/PopupPanel/constants.d.ts +0 -7
- package/dist/components/PopupPanel/index.d.ts +0 -1
- package/dist/components/Radio/component.d.ts +0 -8
- package/dist/components/Radio/index.d.ts +0 -2
- package/dist/components/Radio/interface.d.ts +0 -5
- package/dist/components/ScrollArea/component.d.ts +0 -32
- package/dist/components/ScrollArea/index.d.ts +0 -1
- package/dist/components/Segmented/component.d.ts +0 -10
- package/dist/components/Segmented/index.d.ts +0 -1
- package/dist/components/Select/component.d.ts +0 -24
- package/dist/components/Select/index.d.ts +0 -1
- package/dist/components/Slider/component.d.ts +0 -5
- package/dist/components/Slider/index.d.ts +0 -1
- package/dist/components/Spin/component.d.ts +0 -4
- package/dist/components/Spin/index.d.ts +0 -1
- package/dist/components/Splitter/component.d.ts +0 -13
- package/dist/components/Splitter/index.d.ts +0 -1
- package/dist/components/Stack/Stack.d.ts +0 -39
- package/dist/components/Stack/StackChild.d.ts +0 -30
- package/dist/components/Stack/index.d.ts +0 -8
- package/dist/components/Switch/component.d.ts +0 -9
- package/dist/components/Switch/index.d.ts +0 -1
- package/dist/components/Table/component.d.ts +0 -20
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Tag/component.d.ts +0 -12
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/ThemeProvider/component.d.ts +0 -7
- package/dist/components/ThemeProvider/index.d.ts +0 -1
- package/dist/components/Toast/component.d.ts +0 -15
- package/dist/components/Toast/function.d.ts +0 -10
- package/dist/components/Toast/index.d.ts +0 -3
- package/dist/components/Toast/types.d.ts +0 -3
- package/dist/components/Tooltip/component.d.ts +0 -10
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/components/Tour/component.d.ts +0 -8
- package/dist/components/Tour/index.d.ts +0 -1
- package/dist/components/Transition/component.d.ts +0 -17
- package/dist/components/Transition/index.d.ts +0 -1
- package/dist/components/Tree/components.d.ts +0 -13
- package/dist/components/Tree/helpers.d.ts +0 -4
- package/dist/components/Tree/index.d.ts +0 -4
- package/dist/components/Tree/types.d.ts +0 -55
- package/dist/components/Tree/useTreeCommon.d.ts +0 -178
- package/dist/components/Tree/useUniqueKeysTree.d.ts +0 -33
- package/dist/components/Truncate/component.d.ts +0 -15
- package/dist/components/Truncate/helpers.d.ts +0 -5
- package/dist/components/Truncate/index.d.ts +0 -1
- package/dist/components/Upload/component.d.ts +0 -16
- package/dist/components/Upload/dragger.d.ts +0 -13
- package/dist/components/Upload/hooks.d.ts +0 -5
- package/dist/components/Upload/index.d.ts +0 -4
- package/dist/components/Upload/item.d.ts +0 -11
- package/dist/components/Upload/utils.d.ts +0 -1
- package/dist/components/VerticalCollapsiblePanel/component.d.ts +0 -65
- package/dist/components/VerticalCollapsiblePanel/index.d.ts +0 -1
- package/dist/components/hooks/antd.d.ts +0 -11
- package/dist/components/hooks/base-ui.d.ts +0 -7
- package/dist/components/hooks/index.d.ts +0 -4
- package/dist/components/hooks/useCharts.d.ts +0 -22
- package/dist/components/hooks/useControlledState.d.ts +0 -1
- package/dist/components/index.d.ts +0 -41
- package/dist/components/utils/WithAntdTokens.d.ts +0 -7
- package/dist/components/utils/antdUtils.d.ts +0 -15
- package/dist/components/utils/client.d.ts +0 -2
- package/dist/components/utils/cn.d.ts +0 -4
- package/dist/components/utils/index.d.ts +0 -3
- package/dist/components/utils/isTracebackError.d.ts +0 -1
- package/dist/components/utils/main.d.ts +0 -3
- package/dist/components/utils/reactToString.d.ts +0 -2
- package/dist/components/utils/types.d.ts +0 -9
- package/dist/hooks.js +0 -961
- package/dist/index.css +0 -1471
- package/dist/metadata.d.ts +0 -363
- package/dist/tokens/and-theme/index.d.ts +0 -1
- package/dist/tokens/and-theme/tokens.d.ts +0 -5
- package/dist/tokens/charts/index.d.ts +0 -6
- package/dist/tokens/charts/tokens.d.ts +0 -455
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens/utils.d.ts +0 -16
- package/dist/utils.js +0 -120
package/dist/Upload.js
DELETED
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_upload_29096ddd__ from "antd/es/upload";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_button_8f463bb4__ from "antd/es/button";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__ from "@bioturing/assets";
|
|
6
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_config_provider_6a57beb3__ from "antd/es/config-provider";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_theme_useToken_e8911485__ from "antd/es/theme/useToken";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
9
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_flex_86593150__ from "antd/es/flex";
|
|
10
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_progress_da1757d8__ from "antd/es/progress";
|
|
11
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
12
|
-
import * as __WEBPACK_EXTERNAL_MODULE__base_ui_components_react_5aaa6934__ from "@base-ui-components/react";
|
|
13
|
-
const ButtonInner = ({ style, ...rest }, ref)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_button_8f463bb4__["default"], {
|
|
14
|
-
ref: ref,
|
|
15
|
-
style: style,
|
|
16
|
-
...rest
|
|
17
|
-
});
|
|
18
|
-
const Button = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(ButtonInner);
|
|
19
|
-
function cx(...args) {
|
|
20
|
-
const classes = [];
|
|
21
|
-
for (const arg of args)if (arg) {
|
|
22
|
-
if ("string" == typeof arg || "number" == typeof arg) classes.push(String(arg));
|
|
23
|
-
else if (Array.isArray(arg)) classes.push(...cx(...arg));
|
|
24
|
-
else if ("object" == typeof arg) {
|
|
25
|
-
for (const [key, value] of Object.entries(arg))if (value) classes.push(key);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return classes;
|
|
29
|
-
}
|
|
30
|
-
function clsx(...args) {
|
|
31
|
-
return cx(...args).join(" ");
|
|
32
|
-
}
|
|
33
|
-
function cn(...args) {
|
|
34
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(cx(...args));
|
|
35
|
-
}
|
|
36
|
-
"use client";
|
|
37
|
-
const useGetPrefixCls = ()=>{
|
|
38
|
-
const { getPrefixCls } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE_antd_es_config_provider_6a57beb3__["default"].ConfigContext);
|
|
39
|
-
return {
|
|
40
|
-
getPrefixCls
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const useAntdCssVarClassname = ()=>{
|
|
44
|
-
var _token_;
|
|
45
|
-
const token = (0, __WEBPACK_EXTERNAL_MODULE_antd_es_theme_useToken_e8911485__["default"])();
|
|
46
|
-
return null == (_token_ = token[4]) ? void 0 : _token_.key;
|
|
47
|
-
};
|
|
48
|
-
const useCls = ()=>{
|
|
49
|
-
const { getPrefixCls } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE_antd_es_config_provider_6a57beb3__["default"].ConfigContext);
|
|
50
|
-
return (...args)=>cx(...args).map((cls)=>getPrefixCls(cls)).join(" ");
|
|
51
|
-
};
|
|
52
|
-
function splitCamelCase(text) {
|
|
53
|
-
const result = [];
|
|
54
|
-
let currentWord = "";
|
|
55
|
-
for (const char of text)if (char >= "A" && char <= "Z") {
|
|
56
|
-
if (currentWord) result.push(currentWord);
|
|
57
|
-
currentWord = char.toLowerCase();
|
|
58
|
-
} else currentWord += char;
|
|
59
|
-
if (currentWord) result.push(currentWord);
|
|
60
|
-
return result.length > 0 ? result : [
|
|
61
|
-
text
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
const parseAntdPlacement = (placement = "bottomLeft")=>{
|
|
65
|
-
const [position1, position2] = splitCamelCase(placement);
|
|
66
|
-
let primaryPlacement;
|
|
67
|
-
let align = "center";
|
|
68
|
-
if ("top" === position1 || "bottom" === position1) {
|
|
69
|
-
primaryPlacement = position1;
|
|
70
|
-
if (position2) switch(position2){
|
|
71
|
-
case "left":
|
|
72
|
-
align = "start";
|
|
73
|
-
break;
|
|
74
|
-
case "right":
|
|
75
|
-
align = "end";
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
} else if ("left" === position1 || "right" === position1) {
|
|
79
|
-
primaryPlacement = position1;
|
|
80
|
-
if (position2) switch(position2){
|
|
81
|
-
case "top":
|
|
82
|
-
align = "start";
|
|
83
|
-
break;
|
|
84
|
-
case "bottom":
|
|
85
|
-
align = "end";
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
} else primaryPlacement = "bottom";
|
|
89
|
-
return {
|
|
90
|
-
placement: primaryPlacement,
|
|
91
|
-
align
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
"use client";
|
|
95
|
-
const IconButtonImpl = (props, ref)=>{
|
|
96
|
-
const { label, size = "medium", negativeMargin = true, children, className, tooltipProps = {}, as, href, target, rel, download, hrefLang, referrerPolicy, ...rest } = props;
|
|
97
|
-
const cls = useCls();
|
|
98
|
-
const antdCssVarClassname = useAntdCssVarClassname();
|
|
99
|
-
const buttonClasses = [
|
|
100
|
-
cls("icon-button"),
|
|
101
|
-
cls(`icon-button-${size}`),
|
|
102
|
-
cls(negativeMargin ? "icon-button-negative-margin" : ""),
|
|
103
|
-
antdCssVarClassname,
|
|
104
|
-
className
|
|
105
|
-
].filter(Boolean).join(" ");
|
|
106
|
-
const Component = as || (href ? "a" : "button");
|
|
107
|
-
const anchorProps = "a" === Component ? {
|
|
108
|
-
...void 0 !== target && {
|
|
109
|
-
target
|
|
110
|
-
},
|
|
111
|
-
...void 0 !== rel && {
|
|
112
|
-
rel
|
|
113
|
-
},
|
|
114
|
-
...void 0 !== download && {
|
|
115
|
-
download
|
|
116
|
-
},
|
|
117
|
-
...void 0 !== hrefLang && {
|
|
118
|
-
hrefLang
|
|
119
|
-
},
|
|
120
|
-
...void 0 !== referrerPolicy && {
|
|
121
|
-
referrerPolicy
|
|
122
|
-
}
|
|
123
|
-
} : {};
|
|
124
|
-
const elementProps = {
|
|
125
|
-
ref,
|
|
126
|
-
className: buttonClasses,
|
|
127
|
-
..."button" === Component && {
|
|
128
|
-
type: "button"
|
|
129
|
-
},
|
|
130
|
-
...href && {
|
|
131
|
-
href
|
|
132
|
-
},
|
|
133
|
-
...anchorProps,
|
|
134
|
-
...rest
|
|
135
|
-
};
|
|
136
|
-
const element = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Component, {
|
|
137
|
-
...elementProps,
|
|
138
|
-
children: children
|
|
139
|
-
});
|
|
140
|
-
return label ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tooltip, {
|
|
141
|
-
title: label,
|
|
142
|
-
arrow: false,
|
|
143
|
-
...tooltipProps,
|
|
144
|
-
children: element
|
|
145
|
-
}) : element;
|
|
146
|
-
};
|
|
147
|
-
const IconButton = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(IconButtonImpl);
|
|
148
|
-
const measureText = (container)=>{
|
|
149
|
-
const span = document.createElement("span");
|
|
150
|
-
span.style.opacity = "0";
|
|
151
|
-
span.style.position = "absolute";
|
|
152
|
-
span.style.top = "-1000px";
|
|
153
|
-
span.style.left = "-1000px";
|
|
154
|
-
span.style.whiteSpace = "nowrap";
|
|
155
|
-
span.style.pointerEvents = "none";
|
|
156
|
-
container.appendChild(span);
|
|
157
|
-
return {
|
|
158
|
-
measure: (text)=>{
|
|
159
|
-
span.innerText = text;
|
|
160
|
-
return span.clientWidth;
|
|
161
|
-
},
|
|
162
|
-
destroy: ()=>{
|
|
163
|
-
container.removeChild(span);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
const getMiddleTruncatedString = (text, ellipsis, container)=>{
|
|
168
|
-
var _Object_values_reverse_find;
|
|
169
|
-
if (!text) return text;
|
|
170
|
-
const { measure: getTextWidth, destroy: destroyMeasure } = measureText(container);
|
|
171
|
-
const textWidth = getTextWidth(text);
|
|
172
|
-
const containerWidth = container.clientWidth;
|
|
173
|
-
const initialOffset = Math.floor(containerWidth / textWidth * text.length);
|
|
174
|
-
if (textWidth <= containerWidth) {
|
|
175
|
-
destroyMeasure();
|
|
176
|
-
return text;
|
|
177
|
-
}
|
|
178
|
-
let offset = initialOffset;
|
|
179
|
-
const attempts = {};
|
|
180
|
-
const maxAttempts = 20;
|
|
181
|
-
const buffer = 10;
|
|
182
|
-
while(Object.values(attempts).length <= maxAttempts){
|
|
183
|
-
if (attempts[offset]) break;
|
|
184
|
-
if (offset <= 1) {
|
|
185
|
-
attempts[0] = [
|
|
186
|
-
0,
|
|
187
|
-
ellipsis
|
|
188
|
-
];
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
const start = text.slice(0, Math.ceil((offset - ellipsis.length) / 2 - 1)).trimEnd();
|
|
192
|
-
const end = text.slice(Math.floor((offset - ellipsis.length) / 2) - offset).trimStart();
|
|
193
|
-
const truncatedStr = start + ellipsis + end;
|
|
194
|
-
const width = getTextWidth(truncatedStr);
|
|
195
|
-
attempts[offset] = [
|
|
196
|
-
width,
|
|
197
|
-
truncatedStr
|
|
198
|
-
];
|
|
199
|
-
if (width >= containerWidth) offset -= 2;
|
|
200
|
-
else {
|
|
201
|
-
if (containerWidth - width < buffer) break;
|
|
202
|
-
offset += 2;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
destroyMeasure();
|
|
206
|
-
return (null == (_Object_values_reverse_find = Object.values(attempts).reverse().find(([width])=>width < containerWidth)) ? void 0 : _Object_values_reverse_find[1]) ?? Object.values(attempts)[0][1];
|
|
207
|
-
};
|
|
208
|
-
"use client";
|
|
209
|
-
const Truncate = ({ children, position = "end", lines = 1, className, style, ...rest })=>{
|
|
210
|
-
const cls = useCls();
|
|
211
|
-
const containerRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
212
|
-
const [isTruncated, setIsTruncated] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
213
|
-
const [truncatedText, setTruncatedText] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(children);
|
|
214
|
-
const text = children;
|
|
215
|
-
const getContainerStyles = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
|
|
216
|
-
if ("auto" !== lines) return {
|
|
217
|
-
...style,
|
|
218
|
-
...lines > 1 ? {
|
|
219
|
-
"--ds-line-clamp": lines
|
|
220
|
-
} : {}
|
|
221
|
-
};
|
|
222
|
-
return {
|
|
223
|
-
...style,
|
|
224
|
-
"--ds-line-clamp": 999
|
|
225
|
-
};
|
|
226
|
-
}, [
|
|
227
|
-
lines,
|
|
228
|
-
style
|
|
229
|
-
]);
|
|
230
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useLayoutEffect)(()=>{
|
|
231
|
-
const container = containerRef.current;
|
|
232
|
-
if (!container) return;
|
|
233
|
-
if ("auto" === lines) {
|
|
234
|
-
var _window_document_fonts_ready, _window_document_fonts;
|
|
235
|
-
setTruncatedText(text);
|
|
236
|
-
const calculateLines = ()=>{
|
|
237
|
-
const parent = container.parentElement;
|
|
238
|
-
if (!parent) return;
|
|
239
|
-
const styles = window.getComputedStyle(container);
|
|
240
|
-
const fontSize = parseFloat(styles.fontSize);
|
|
241
|
-
const lineHeight = "normal" === styles.lineHeight ? 1.2 * fontSize : parseFloat(styles.lineHeight);
|
|
242
|
-
const parentStyles = window.getComputedStyle(parent);
|
|
243
|
-
const paddingTop = parseFloat(parentStyles.paddingTop) || 0;
|
|
244
|
-
const paddingBottom = parseFloat(parentStyles.paddingBottom) || 0;
|
|
245
|
-
const borderTopWidth = parseFloat(parentStyles.borderTopWidth) || 0;
|
|
246
|
-
const borderBottomWidth = parseFloat(parentStyles.borderBottomWidth) || 0;
|
|
247
|
-
const parentHeight = parent.clientHeight;
|
|
248
|
-
const availableHeight = parentHeight - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;
|
|
249
|
-
const maxLines = Math.max(1, Math.floor(availableHeight / lineHeight));
|
|
250
|
-
if (container) container.style.setProperty("--ds-line-clamp", String(maxLines));
|
|
251
|
-
const clone = document.createElement("span");
|
|
252
|
-
clone.style.visibility = "hidden";
|
|
253
|
-
clone.style.position = "absolute";
|
|
254
|
-
clone.style.width = `${container.clientWidth}px`;
|
|
255
|
-
clone.style.fontSize = styles.fontSize;
|
|
256
|
-
clone.style.fontFamily = styles.fontFamily;
|
|
257
|
-
clone.style.lineHeight = styles.lineHeight;
|
|
258
|
-
clone.textContent = text;
|
|
259
|
-
document.body.appendChild(clone);
|
|
260
|
-
const isTruncated = clone.scrollHeight > availableHeight;
|
|
261
|
-
document.body.removeChild(clone);
|
|
262
|
-
setIsTruncated(isTruncated);
|
|
263
|
-
};
|
|
264
|
-
null == (_window_document_fonts = window.document.fonts) || null == (_window_document_fonts_ready = _window_document_fonts.ready) || _window_document_fonts_ready.then(calculateLines);
|
|
265
|
-
const observer = new ResizeObserver(()=>{
|
|
266
|
-
window.requestAnimationFrame(calculateLines);
|
|
267
|
-
});
|
|
268
|
-
observer.observe(container);
|
|
269
|
-
if (container.parentElement) observer.observe(container.parentElement);
|
|
270
|
-
return ()=>observer.disconnect();
|
|
271
|
-
}
|
|
272
|
-
if ("number" == typeof lines && lines > 1) {
|
|
273
|
-
var _window_document_fonts_ready1, _window_document_fonts1;
|
|
274
|
-
setTruncatedText(text);
|
|
275
|
-
const checkIfTruncated = ()=>{
|
|
276
|
-
const clone = document.createElement("span");
|
|
277
|
-
clone.style.visibility = "hidden";
|
|
278
|
-
clone.style.position = "absolute";
|
|
279
|
-
clone.style.width = `${container.clientWidth}px`;
|
|
280
|
-
clone.textContent = text;
|
|
281
|
-
document.body.appendChild(clone);
|
|
282
|
-
const isTruncated = clone.scrollHeight > (container.clientHeight || container.offsetHeight);
|
|
283
|
-
document.body.removeChild(clone);
|
|
284
|
-
setIsTruncated(isTruncated);
|
|
285
|
-
};
|
|
286
|
-
null == (_window_document_fonts1 = window.document.fonts) || null == (_window_document_fonts_ready1 = _window_document_fonts1.ready) || _window_document_fonts_ready1.then(checkIfTruncated);
|
|
287
|
-
const observer = new ResizeObserver(()=>{
|
|
288
|
-
window.requestAnimationFrame(checkIfTruncated);
|
|
289
|
-
});
|
|
290
|
-
observer.observe(container);
|
|
291
|
-
return ()=>observer.disconnect();
|
|
292
|
-
}
|
|
293
|
-
let cancellationToken = {
|
|
294
|
-
cancelled: false
|
|
295
|
-
};
|
|
296
|
-
const calculateTruncatedString = ()=>{
|
|
297
|
-
if (cancellationToken) cancellationToken.cancelled = true;
|
|
298
|
-
const requestCancellationToken = {
|
|
299
|
-
cancelled: false
|
|
300
|
-
};
|
|
301
|
-
cancellationToken = requestCancellationToken;
|
|
302
|
-
const truncated = getMiddleTruncatedString(text, "\u2026", container);
|
|
303
|
-
if (requestCancellationToken.cancelled) return;
|
|
304
|
-
setTruncatedText(truncated);
|
|
305
|
-
};
|
|
306
|
-
if ("middle" == position) {
|
|
307
|
-
var _window_document_fonts_ready2, _window_document_fonts2;
|
|
308
|
-
null == (_window_document_fonts2 = window.document.fonts) || null == (_window_document_fonts_ready2 = _window_document_fonts2.ready) || _window_document_fonts_ready2.then(calculateTruncatedString);
|
|
309
|
-
}
|
|
310
|
-
if ("end" == position) setTruncatedText(text);
|
|
311
|
-
const observer = new ResizeObserver(()=>{
|
|
312
|
-
if ("middle" == position) window.requestAnimationFrame(calculateTruncatedString);
|
|
313
|
-
if ("end" == position) {
|
|
314
|
-
const isOverflowing = container.scrollWidth > container.clientWidth;
|
|
315
|
-
if (isOverflowing) setIsTruncated(true);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
observer.observe(container);
|
|
319
|
-
return ()=>{
|
|
320
|
-
cancellationToken.cancelled = true;
|
|
321
|
-
observer.disconnect();
|
|
322
|
-
};
|
|
323
|
-
}, [
|
|
324
|
-
text,
|
|
325
|
-
position,
|
|
326
|
-
lines
|
|
327
|
-
]);
|
|
328
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
329
|
-
ref: containerRef,
|
|
330
|
-
style: getContainerStyles(),
|
|
331
|
-
className: clsx(1 === lines ? cls("truncate") : cls("truncate-multiline"), "middle" === position ? cls("truncate-middle") : cls("truncate-end"), className),
|
|
332
|
-
title: isTruncated ? text : void 0,
|
|
333
|
-
...rest,
|
|
334
|
-
children: text === truncatedText ? text : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
335
|
-
children: truncatedText
|
|
336
|
-
})
|
|
337
|
-
});
|
|
338
|
-
};
|
|
339
|
-
const getUploadFileIcon = (fileType)=>"folder" === fileType ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.Folder, {
|
|
340
|
-
size: 20,
|
|
341
|
-
weight: "fill"
|
|
342
|
-
}) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.File, {
|
|
343
|
-
size: 20,
|
|
344
|
-
weight: "fill"
|
|
345
|
-
});
|
|
346
|
-
const UploadItem = ({ fileName, fileType, status = "pending", percent, removable = true, onRemove, extraActions })=>{
|
|
347
|
-
const cls = useCls();
|
|
348
|
-
const showPercent = Math.round(percent || 0);
|
|
349
|
-
const statusWithProgress = {
|
|
350
|
-
done: "success",
|
|
351
|
-
error: "exception",
|
|
352
|
-
uploading: "active",
|
|
353
|
-
removed: "normal",
|
|
354
|
-
pending: "normal"
|
|
355
|
-
};
|
|
356
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_flex_86593150__["default"], {
|
|
357
|
-
className: clsx(cls("upload-item")),
|
|
358
|
-
justify: "space-between",
|
|
359
|
-
align: "center",
|
|
360
|
-
"data-error": "error" === status,
|
|
361
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd_es_flex_86593150__["default"], {
|
|
362
|
-
align: "center",
|
|
363
|
-
gap: 16,
|
|
364
|
-
flex: 1,
|
|
365
|
-
className: cls("upload-item-content"),
|
|
366
|
-
children: [
|
|
367
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
368
|
-
className: cls("upload-item-icon"),
|
|
369
|
-
children: getUploadFileIcon(fileType)
|
|
370
|
-
}),
|
|
371
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd_es_flex_86593150__["default"], {
|
|
372
|
-
align: "start",
|
|
373
|
-
vertical: true,
|
|
374
|
-
flex: 1,
|
|
375
|
-
className: cls("upload-item-name-progress"),
|
|
376
|
-
children: [
|
|
377
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Truncate, {
|
|
378
|
-
position: "middle",
|
|
379
|
-
children: fileName
|
|
380
|
-
}),
|
|
381
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_progress_da1757d8__["default"], {
|
|
382
|
-
percent: showPercent,
|
|
383
|
-
size: "small",
|
|
384
|
-
className: cls("upload-item-progress"),
|
|
385
|
-
status: status && status in statusWithProgress ? statusWithProgress[status] : "normal"
|
|
386
|
-
})
|
|
387
|
-
]
|
|
388
|
-
}),
|
|
389
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd_es_flex_86593150__["default"], {
|
|
390
|
-
gap: 8,
|
|
391
|
-
align: "center",
|
|
392
|
-
children: [
|
|
393
|
-
extraActions,
|
|
394
|
-
removable && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(IconButton, {
|
|
395
|
-
label: "Remove",
|
|
396
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.Trash, {
|
|
397
|
-
size: 16
|
|
398
|
-
}),
|
|
399
|
-
onClick: onRemove,
|
|
400
|
-
size: "small"
|
|
401
|
-
})
|
|
402
|
-
]
|
|
403
|
-
})
|
|
404
|
-
]
|
|
405
|
-
})
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
"use client";
|
|
409
|
-
const useUploadItemRender = ({ showRemoveButton = true })=>{
|
|
410
|
-
const itemRender = (_originNode, file, _fileList, actions)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(UploadItem, {
|
|
411
|
-
fileName: file.name,
|
|
412
|
-
fileType: file.type,
|
|
413
|
-
status: file.status,
|
|
414
|
-
percent: file.percent,
|
|
415
|
-
removable: showRemoveButton,
|
|
416
|
-
onRemove: ()=>actions.remove()
|
|
417
|
-
});
|
|
418
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(itemRender, [
|
|
419
|
-
showRemoveButton
|
|
420
|
-
]);
|
|
421
|
-
};
|
|
422
|
-
"use client";
|
|
423
|
-
const Dragger = ({ children, uploadTitle = "Click or drag file to this area to upload", uploadDescription = "Support for a single or bulk upload.", itemRender, ...rest })=>{
|
|
424
|
-
const cls = useCls();
|
|
425
|
-
const renderChildren = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
|
|
426
|
-
children: [
|
|
427
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
|
|
428
|
-
className: cls("upload-drag-icon"),
|
|
429
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.CloudArrowUp, {
|
|
430
|
-
size: 40
|
|
431
|
-
})
|
|
432
|
-
}),
|
|
433
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
|
|
434
|
-
className: cls("upload-text"),
|
|
435
|
-
children: uploadTitle
|
|
436
|
-
}),
|
|
437
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
|
|
438
|
-
className: cls("upload-hint"),
|
|
439
|
-
children: uploadDescription
|
|
440
|
-
})
|
|
441
|
-
]
|
|
442
|
-
});
|
|
443
|
-
const defaultItemRender = useUploadItemRender({
|
|
444
|
-
showRemoveButton: true
|
|
445
|
-
});
|
|
446
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_upload_29096ddd__["default"].Dragger, {
|
|
447
|
-
itemRender: itemRender || defaultItemRender,
|
|
448
|
-
...rest,
|
|
449
|
-
children: children ? children : renderChildren()
|
|
450
|
-
});
|
|
451
|
-
};
|
|
452
|
-
"use client";
|
|
453
|
-
const DefaultUpload = ({ showRemoveButton = true, className, fileList, children, ...restProps })=>{
|
|
454
|
-
const cls = useCls();
|
|
455
|
-
const icon = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.CloudArrowUp, {
|
|
456
|
-
size: 24
|
|
457
|
-
});
|
|
458
|
-
const defaultChildren = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Button, {
|
|
459
|
-
icon: icon,
|
|
460
|
-
type: "default",
|
|
461
|
-
children: "Upload Files"
|
|
462
|
-
});
|
|
463
|
-
const itemRender = useUploadItemRender({
|
|
464
|
-
showRemoveButton
|
|
465
|
-
});
|
|
466
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_upload_29096ddd__["default"], {
|
|
467
|
-
className: clsx(cls("upload"), className),
|
|
468
|
-
...restProps,
|
|
469
|
-
fileList: fileList,
|
|
470
|
-
itemRender: itemRender,
|
|
471
|
-
children: children || defaultChildren
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
const Upload = Object.assign(DefaultUpload, {
|
|
475
|
-
Dragger: Dragger,
|
|
476
|
-
Item: UploadItem
|
|
477
|
-
});
|
|
478
|
-
function reactNodeToString(node) {
|
|
479
|
-
if (null == node) return "";
|
|
480
|
-
if ("string" == typeof node) return node;
|
|
481
|
-
if ("number" == typeof node || "boolean" == typeof node) return node.toString();
|
|
482
|
-
if (Array.isArray(node)) return node.map(reactNodeToString).join("");
|
|
483
|
-
if ((0, __WEBPACK_EXTERNAL_MODULE_react__.isValidElement)(node) && "props" in node && node.props && "object" == typeof node.props && "children" in node.props && node.props.children) {
|
|
484
|
-
if ("br" === node.type) return "\n";
|
|
485
|
-
if (node.props.children) return reactNodeToString(node.props.children);
|
|
486
|
-
}
|
|
487
|
-
return "";
|
|
488
|
-
}
|
|
489
|
-
function isTracebackError(error) {
|
|
490
|
-
if (!error || "string" != typeof error && !error.toString) return false;
|
|
491
|
-
const errorString = "string" == typeof error ? error : error.toString();
|
|
492
|
-
const pythonTracebackRegex = /Traceback \(most recent call last\):/;
|
|
493
|
-
const pythonStackFrameRegex = /File ".*?", line \d+, in/;
|
|
494
|
-
const goStackTraceRegex = /goroutine \d+ \[.*\]:|panic: /;
|
|
495
|
-
const goStackFrameRegex = /\/.*\.go:\d+/;
|
|
496
|
-
const isPythonTraceback = pythonTracebackRegex.test(errorString) || pythonStackFrameRegex.test(errorString);
|
|
497
|
-
const isGoStackTrace = goStackTraceRegex.test(errorString) || goStackFrameRegex.test(errorString);
|
|
498
|
-
return isPythonTraceback || isGoStackTrace;
|
|
499
|
-
}
|
|
500
|
-
"use client";
|
|
501
|
-
const WithAntdTokens = ({ as: Tag = "div", ref, className, ...rest })=>{
|
|
502
|
-
const Component = Tag;
|
|
503
|
-
const cssVar = useAntdCssVarClassname();
|
|
504
|
-
const { renderElement } = (0, __WEBPACK_EXTERNAL_MODULE__base_ui_components_react_5aaa6934__.useRender)({
|
|
505
|
-
render: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Component, {}),
|
|
506
|
-
refs: [
|
|
507
|
-
ref
|
|
508
|
-
],
|
|
509
|
-
props: {
|
|
510
|
-
...rest,
|
|
511
|
-
className: clsx(className, cssVar)
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
return renderElement();
|
|
515
|
-
};
|
|
516
|
-
export { DefaultUpload, Upload, WithAntdTokens, clsx, cn, cx, isTracebackError, parseAntdPlacement, reactNodeToString, useAntdCssVarClassname, useCls, useGetPrefixCls, useUploadItemRender };
|