@bioturing/components 0.15.0 → 0.15.2
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 +68 -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/style.css +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/Modal.js
DELETED
|
@@ -1,677 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_app_useApp_90d95086__ from "antd/es/app/useApp";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_modal_52965d33__ from "antd/es/modal";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__ from "@bioturing/assets";
|
|
6
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_config_provider_6a57beb3__ from "antd/es/config-provider";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_theme_useToken_e8911485__ from "antd/es/theme/useToken";
|
|
9
|
-
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
10
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_modal_context_bc73863f__ from "antd/es/modal/context";
|
|
11
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_modal_components_NormalCancelBtn_54ff398c__ from "antd/es/modal/components/NormalCancelBtn";
|
|
12
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_modal_components_NormalOkBtn_897b50c4__ from "antd/es/modal/components/NormalOkBtn";
|
|
13
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_modal_locale_f16c0933__ from "antd/es/modal/locale";
|
|
14
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_locale_31079002__ from "antd/es/locale";
|
|
15
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
16
|
-
import * as __WEBPACK_EXTERNAL_MODULE__base_ui_components_react_use_render_2fb9dc6d__ from "@base-ui-components/react/use-render";
|
|
17
|
-
import * as __WEBPACK_EXTERNAL_MODULE__base_ui_components_react_merge_props_04b69945__ from "@base-ui-components/react/merge-props";
|
|
18
|
-
function cx(...args) {
|
|
19
|
-
const classes = [];
|
|
20
|
-
for (const arg of args)if (arg) {
|
|
21
|
-
if ("string" == typeof arg || "number" == typeof arg) classes.push(String(arg));
|
|
22
|
-
else if (Array.isArray(arg)) classes.push(...cx(...arg));
|
|
23
|
-
else if ("object" == typeof arg) {
|
|
24
|
-
for (const [key, value] of Object.entries(arg))if (value) classes.push(key);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return classes;
|
|
28
|
-
}
|
|
29
|
-
function clsx(...args) {
|
|
30
|
-
return cx(...args).join(" ");
|
|
31
|
-
}
|
|
32
|
-
function cn(...args) {
|
|
33
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(cx(...args));
|
|
34
|
-
}
|
|
35
|
-
"use client";
|
|
36
|
-
const useAntdCssVarClassname = ()=>{
|
|
37
|
-
var _token_;
|
|
38
|
-
const token = (0, __WEBPACK_EXTERNAL_MODULE_antd_es_theme_useToken_e8911485__["default"])();
|
|
39
|
-
return null == (_token_ = token[4]) ? void 0 : _token_.key;
|
|
40
|
-
};
|
|
41
|
-
const useCls = ()=>{
|
|
42
|
-
const { getPrefixCls } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE_antd_es_config_provider_6a57beb3__["default"].ConfigContext);
|
|
43
|
-
return (...args)=>cx(...args).map((cls)=>getPrefixCls(cls)).join(" ");
|
|
44
|
-
};
|
|
45
|
-
"use client";
|
|
46
|
-
const IconButtonImpl = (props, ref)=>{
|
|
47
|
-
const { label, size = "medium", negativeMargin = true, children, className, tooltipProps = {}, as, href, target, rel, download, hrefLang, referrerPolicy, ...rest } = props;
|
|
48
|
-
const cls = useCls();
|
|
49
|
-
const antdCssVarClassname = useAntdCssVarClassname();
|
|
50
|
-
const buttonClasses = [
|
|
51
|
-
cls("icon-button"),
|
|
52
|
-
cls(`icon-button-${size}`),
|
|
53
|
-
cls(negativeMargin ? "icon-button-negative-margin" : ""),
|
|
54
|
-
antdCssVarClassname,
|
|
55
|
-
className
|
|
56
|
-
].filter(Boolean).join(" ");
|
|
57
|
-
const Component = as || (href ? "a" : "button");
|
|
58
|
-
const anchorProps = "a" === Component ? {
|
|
59
|
-
...void 0 !== target && {
|
|
60
|
-
target
|
|
61
|
-
},
|
|
62
|
-
...void 0 !== rel && {
|
|
63
|
-
rel
|
|
64
|
-
},
|
|
65
|
-
...void 0 !== download && {
|
|
66
|
-
download
|
|
67
|
-
},
|
|
68
|
-
...void 0 !== hrefLang && {
|
|
69
|
-
hrefLang
|
|
70
|
-
},
|
|
71
|
-
...void 0 !== referrerPolicy && {
|
|
72
|
-
referrerPolicy
|
|
73
|
-
}
|
|
74
|
-
} : {};
|
|
75
|
-
const elementProps = {
|
|
76
|
-
ref,
|
|
77
|
-
className: buttonClasses,
|
|
78
|
-
..."button" === Component && {
|
|
79
|
-
type: "button"
|
|
80
|
-
},
|
|
81
|
-
...href && {
|
|
82
|
-
href
|
|
83
|
-
},
|
|
84
|
-
...anchorProps,
|
|
85
|
-
...rest
|
|
86
|
-
};
|
|
87
|
-
const element = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Component, {
|
|
88
|
-
...elementProps,
|
|
89
|
-
children: children
|
|
90
|
-
});
|
|
91
|
-
return label ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tooltip, {
|
|
92
|
-
title: label,
|
|
93
|
-
arrow: false,
|
|
94
|
-
...tooltipProps,
|
|
95
|
-
children: element
|
|
96
|
-
}) : element;
|
|
97
|
-
};
|
|
98
|
-
const IconButton = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.forwardRef)(IconButtonImpl);
|
|
99
|
-
var constants_ModalSize = /*#__PURE__*/ function(ModalSize) {
|
|
100
|
-
ModalSize["xsmall"] = "400px";
|
|
101
|
-
ModalSize["small"] = "520px";
|
|
102
|
-
ModalSize["medium"] = "640px";
|
|
103
|
-
ModalSize["large"] = "840px";
|
|
104
|
-
ModalSize["xlarge"] = "1024px";
|
|
105
|
-
ModalSize["xxlarge"] = "1280px";
|
|
106
|
-
ModalSize["fullscreen"] = "100%";
|
|
107
|
-
return ModalSize;
|
|
108
|
-
}({});
|
|
109
|
-
const measureText = (container)=>{
|
|
110
|
-
const span = document.createElement("span");
|
|
111
|
-
span.style.opacity = "0";
|
|
112
|
-
span.style.position = "absolute";
|
|
113
|
-
span.style.top = "-1000px";
|
|
114
|
-
span.style.left = "-1000px";
|
|
115
|
-
span.style.whiteSpace = "nowrap";
|
|
116
|
-
span.style.pointerEvents = "none";
|
|
117
|
-
container.appendChild(span);
|
|
118
|
-
return {
|
|
119
|
-
measure: (text)=>{
|
|
120
|
-
span.innerText = text;
|
|
121
|
-
return span.clientWidth;
|
|
122
|
-
},
|
|
123
|
-
destroy: ()=>{
|
|
124
|
-
container.removeChild(span);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
const getMiddleTruncatedString = (text, ellipsis, container)=>{
|
|
129
|
-
var _Object_values_reverse_find;
|
|
130
|
-
if (!text) return text;
|
|
131
|
-
const { measure: getTextWidth, destroy: destroyMeasure } = measureText(container);
|
|
132
|
-
const textWidth = getTextWidth(text);
|
|
133
|
-
const containerWidth = container.clientWidth;
|
|
134
|
-
const initialOffset = Math.floor(containerWidth / textWidth * text.length);
|
|
135
|
-
if (textWidth <= containerWidth) {
|
|
136
|
-
destroyMeasure();
|
|
137
|
-
return text;
|
|
138
|
-
}
|
|
139
|
-
let offset = initialOffset;
|
|
140
|
-
const attempts = {};
|
|
141
|
-
const maxAttempts = 20;
|
|
142
|
-
const buffer = 10;
|
|
143
|
-
while(Object.values(attempts).length <= maxAttempts){
|
|
144
|
-
if (attempts[offset]) break;
|
|
145
|
-
if (offset <= 1) {
|
|
146
|
-
attempts[0] = [
|
|
147
|
-
0,
|
|
148
|
-
ellipsis
|
|
149
|
-
];
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
const start = text.slice(0, Math.ceil((offset - ellipsis.length) / 2 - 1)).trimEnd();
|
|
153
|
-
const end = text.slice(Math.floor((offset - ellipsis.length) / 2) - offset).trimStart();
|
|
154
|
-
const truncatedStr = start + ellipsis + end;
|
|
155
|
-
const width = getTextWidth(truncatedStr);
|
|
156
|
-
attempts[offset] = [
|
|
157
|
-
width,
|
|
158
|
-
truncatedStr
|
|
159
|
-
];
|
|
160
|
-
if (width >= containerWidth) offset -= 2;
|
|
161
|
-
else {
|
|
162
|
-
if (containerWidth - width < buffer) break;
|
|
163
|
-
offset += 2;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
destroyMeasure();
|
|
167
|
-
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];
|
|
168
|
-
};
|
|
169
|
-
"use client";
|
|
170
|
-
const Truncate = ({ children, position = "end", lines = 1, className, style, ...rest })=>{
|
|
171
|
-
const cls = useCls();
|
|
172
|
-
const containerRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
173
|
-
const [isTruncated, setIsTruncated] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
174
|
-
const [truncatedText, setTruncatedText] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(children);
|
|
175
|
-
const text = children;
|
|
176
|
-
const getContainerStyles = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>{
|
|
177
|
-
if ("auto" !== lines) return {
|
|
178
|
-
...style,
|
|
179
|
-
...lines > 1 ? {
|
|
180
|
-
"--ds-line-clamp": lines
|
|
181
|
-
} : {}
|
|
182
|
-
};
|
|
183
|
-
return {
|
|
184
|
-
...style,
|
|
185
|
-
"--ds-line-clamp": 999
|
|
186
|
-
};
|
|
187
|
-
}, [
|
|
188
|
-
lines,
|
|
189
|
-
style
|
|
190
|
-
]);
|
|
191
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useLayoutEffect)(()=>{
|
|
192
|
-
const container = containerRef.current;
|
|
193
|
-
if (!container) return;
|
|
194
|
-
if ("auto" === lines) {
|
|
195
|
-
var _window_document_fonts_ready, _window_document_fonts;
|
|
196
|
-
setTruncatedText(text);
|
|
197
|
-
const calculateLines = ()=>{
|
|
198
|
-
const parent = container.parentElement;
|
|
199
|
-
if (!parent) return;
|
|
200
|
-
const styles = window.getComputedStyle(container);
|
|
201
|
-
const fontSize = parseFloat(styles.fontSize);
|
|
202
|
-
const lineHeight = "normal" === styles.lineHeight ? 1.2 * fontSize : parseFloat(styles.lineHeight);
|
|
203
|
-
const parentStyles = window.getComputedStyle(parent);
|
|
204
|
-
const paddingTop = parseFloat(parentStyles.paddingTop) || 0;
|
|
205
|
-
const paddingBottom = parseFloat(parentStyles.paddingBottom) || 0;
|
|
206
|
-
const borderTopWidth = parseFloat(parentStyles.borderTopWidth) || 0;
|
|
207
|
-
const borderBottomWidth = parseFloat(parentStyles.borderBottomWidth) || 0;
|
|
208
|
-
const parentHeight = parent.clientHeight;
|
|
209
|
-
const availableHeight = parentHeight - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;
|
|
210
|
-
const maxLines = Math.max(1, Math.floor(availableHeight / lineHeight));
|
|
211
|
-
if (container) container.style.setProperty("--ds-line-clamp", String(maxLines));
|
|
212
|
-
const clone = document.createElement("span");
|
|
213
|
-
clone.style.visibility = "hidden";
|
|
214
|
-
clone.style.position = "absolute";
|
|
215
|
-
clone.style.width = `${container.clientWidth}px`;
|
|
216
|
-
clone.style.fontSize = styles.fontSize;
|
|
217
|
-
clone.style.fontFamily = styles.fontFamily;
|
|
218
|
-
clone.style.lineHeight = styles.lineHeight;
|
|
219
|
-
clone.textContent = text;
|
|
220
|
-
document.body.appendChild(clone);
|
|
221
|
-
const isTruncated = clone.scrollHeight > availableHeight;
|
|
222
|
-
document.body.removeChild(clone);
|
|
223
|
-
setIsTruncated(isTruncated);
|
|
224
|
-
};
|
|
225
|
-
null == (_window_document_fonts = window.document.fonts) || null == (_window_document_fonts_ready = _window_document_fonts.ready) || _window_document_fonts_ready.then(calculateLines);
|
|
226
|
-
const observer = new ResizeObserver(()=>{
|
|
227
|
-
window.requestAnimationFrame(calculateLines);
|
|
228
|
-
});
|
|
229
|
-
observer.observe(container);
|
|
230
|
-
if (container.parentElement) observer.observe(container.parentElement);
|
|
231
|
-
return ()=>observer.disconnect();
|
|
232
|
-
}
|
|
233
|
-
if ("number" == typeof lines && lines > 1) {
|
|
234
|
-
var _window_document_fonts_ready1, _window_document_fonts1;
|
|
235
|
-
setTruncatedText(text);
|
|
236
|
-
const checkIfTruncated = ()=>{
|
|
237
|
-
const clone = document.createElement("span");
|
|
238
|
-
clone.style.visibility = "hidden";
|
|
239
|
-
clone.style.position = "absolute";
|
|
240
|
-
clone.style.width = `${container.clientWidth}px`;
|
|
241
|
-
clone.textContent = text;
|
|
242
|
-
document.body.appendChild(clone);
|
|
243
|
-
const isTruncated = clone.scrollHeight > (container.clientHeight || container.offsetHeight);
|
|
244
|
-
document.body.removeChild(clone);
|
|
245
|
-
setIsTruncated(isTruncated);
|
|
246
|
-
};
|
|
247
|
-
null == (_window_document_fonts1 = window.document.fonts) || null == (_window_document_fonts_ready1 = _window_document_fonts1.ready) || _window_document_fonts_ready1.then(checkIfTruncated);
|
|
248
|
-
const observer = new ResizeObserver(()=>{
|
|
249
|
-
window.requestAnimationFrame(checkIfTruncated);
|
|
250
|
-
});
|
|
251
|
-
observer.observe(container);
|
|
252
|
-
return ()=>observer.disconnect();
|
|
253
|
-
}
|
|
254
|
-
let cancellationToken = {
|
|
255
|
-
cancelled: false
|
|
256
|
-
};
|
|
257
|
-
const calculateTruncatedString = ()=>{
|
|
258
|
-
if (cancellationToken) cancellationToken.cancelled = true;
|
|
259
|
-
const requestCancellationToken = {
|
|
260
|
-
cancelled: false
|
|
261
|
-
};
|
|
262
|
-
cancellationToken = requestCancellationToken;
|
|
263
|
-
const truncated = getMiddleTruncatedString(text, "\u2026", container);
|
|
264
|
-
if (requestCancellationToken.cancelled) return;
|
|
265
|
-
setTruncatedText(truncated);
|
|
266
|
-
};
|
|
267
|
-
if ("middle" == position) {
|
|
268
|
-
var _window_document_fonts_ready2, _window_document_fonts2;
|
|
269
|
-
null == (_window_document_fonts2 = window.document.fonts) || null == (_window_document_fonts_ready2 = _window_document_fonts2.ready) || _window_document_fonts_ready2.then(calculateTruncatedString);
|
|
270
|
-
}
|
|
271
|
-
if ("end" == position) setTruncatedText(text);
|
|
272
|
-
const observer = new ResizeObserver(()=>{
|
|
273
|
-
if ("middle" == position) window.requestAnimationFrame(calculateTruncatedString);
|
|
274
|
-
if ("end" == position) {
|
|
275
|
-
const isOverflowing = container.scrollWidth > container.clientWidth;
|
|
276
|
-
if (isOverflowing) setIsTruncated(true);
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
observer.observe(container);
|
|
280
|
-
return ()=>{
|
|
281
|
-
cancellationToken.cancelled = true;
|
|
282
|
-
observer.disconnect();
|
|
283
|
-
};
|
|
284
|
-
}, [
|
|
285
|
-
text,
|
|
286
|
-
position,
|
|
287
|
-
lines
|
|
288
|
-
]);
|
|
289
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
290
|
-
ref: containerRef,
|
|
291
|
-
style: getContainerStyles(),
|
|
292
|
-
className: clsx(1 === lines ? cls("truncate") : cls("truncate-multiline"), "middle" === position ? cls("truncate-middle") : cls("truncate-end"), className),
|
|
293
|
-
title: isTruncated ? text : void 0,
|
|
294
|
-
...rest,
|
|
295
|
-
children: text === truncatedText ? text : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
296
|
-
children: truncatedText
|
|
297
|
-
})
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
const Stack = ({ hug = false, align = "flex-start", justify = "flex-start", vertical = false, gap = 0, wrap = false, className, children, ...rest })=>{
|
|
301
|
-
const cls = useCls();
|
|
302
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
303
|
-
className: cn(cls("stack"), hug ? cls("stack-hug") : cls("stack-fill"), cls(`stack-gap-${gap}`), vertical ? cls("stack-vertical") : cls("stack-horizontal"), wrap && cls("stack-wrap"), cls(`stack-align-${align}`), cls(`stack-justify-${justify}`), className),
|
|
304
|
-
...rest,
|
|
305
|
-
children: children
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
const StackChild = ({ flex, grow = false, shrink = false, children, style, stack = false, hug = false, align = "flex-start", justify = "flex-start", vertical = false, gap = 0, wrap = false, className, ...rest })=>{
|
|
309
|
-
const cls = useCls();
|
|
310
|
-
const stackProps = {
|
|
311
|
-
hug,
|
|
312
|
-
align,
|
|
313
|
-
justify,
|
|
314
|
-
vertical,
|
|
315
|
-
gap,
|
|
316
|
-
wrap
|
|
317
|
-
};
|
|
318
|
-
let flexClass = "";
|
|
319
|
-
if ("boolean" == typeof flex) flexClass = flex ? cls("stack-child-flex-1") : cls("stack-child-flex-0");
|
|
320
|
-
const combinedClassName = cn(cls("stack-child"), grow && cls("stack-child-grow"), shrink && cls("stack-child-shrink"), flexClass, className);
|
|
321
|
-
const flexValue = "string" == typeof flex || "number" == typeof flex ? flex : void 0;
|
|
322
|
-
const { renderElement } = (0, __WEBPACK_EXTERNAL_MODULE__base_ui_components_react_use_render_2fb9dc6d__.useRender)({
|
|
323
|
-
render: ()=>/*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].isValidElement(children) ? children : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
324
|
-
children: children
|
|
325
|
-
}),
|
|
326
|
-
props: (0, __WEBPACK_EXTERNAL_MODULE__base_ui_components_react_merge_props_04b69945__.mergeProps)({
|
|
327
|
-
className: combinedClassName,
|
|
328
|
-
style: {
|
|
329
|
-
...style,
|
|
330
|
-
flex: flexValue
|
|
331
|
-
},
|
|
332
|
-
...rest
|
|
333
|
-
})
|
|
334
|
-
});
|
|
335
|
-
return stack ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Stack, {
|
|
336
|
-
...stackProps,
|
|
337
|
-
className: combinedClassName,
|
|
338
|
-
children: children
|
|
339
|
-
}) : renderElement();
|
|
340
|
-
};
|
|
341
|
-
const Stack_Stack = Object.assign(Stack, {
|
|
342
|
-
Child: StackChild
|
|
343
|
-
});
|
|
344
|
-
"use client";
|
|
345
|
-
const Modal = ({ open: externalOpen, closeIcon, children, size: sizeProp, footer, width, style, styles, classNames, okButtonProps, cancelButtonProps, loading, onOk, onCancel, okText, okType = "primary", confirmLoading, cancelText = "Close", hideOkButton = false, hideCancelButton = false, contentPadding, title, afterTitle, beforeCloseButton, afterCloseButton, defaultFixedHeaderFooter = false, centered = true, type = "default", defaultOpen = true, background: backgroundProp, bodyScrollable = true, ...rest })=>{
|
|
346
|
-
const defaultCloseIcon = void 0 === closeIcon ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__bioturing_assets_dd0c210d__.XIcon, {
|
|
347
|
-
size: 16,
|
|
348
|
-
weight: "bold"
|
|
349
|
-
}) : closeIcon;
|
|
350
|
-
const defaultModalSize = "default" === type ? "medium" : "xsmall";
|
|
351
|
-
const size = sizeProp || defaultModalSize;
|
|
352
|
-
const modalWidth = width || constants_ModalSize[size];
|
|
353
|
-
const background = backgroundProp || (size && size in constants_ModalSize && parseInt(constants_ModalSize[size]) <= parseInt(constants_ModalSize.medium) ? "elevated" : "container");
|
|
354
|
-
const modalStyle = {
|
|
355
|
-
"--ds-modal-bg": `var(--ds-color-bg-${background})`,
|
|
356
|
-
...style,
|
|
357
|
-
..."fullscreen" === size ? {
|
|
358
|
-
top: 0,
|
|
359
|
-
maxWidth: "100%",
|
|
360
|
-
height: "100%"
|
|
361
|
-
} : {}
|
|
362
|
-
};
|
|
363
|
-
const modalStyles = {
|
|
364
|
-
...styles,
|
|
365
|
-
body: {
|
|
366
|
-
...void 0 !== contentPadding ? {
|
|
367
|
-
"--ds-modal-content-padding": false === contentPadding || 0 === contentPadding ? "0" : "number" == typeof contentPadding ? `${contentPadding}px` : contentPadding
|
|
368
|
-
} : {},
|
|
369
|
-
...null == styles ? void 0 : styles.body
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
const [isContentOverflow, setIsContentOverflow] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
373
|
-
const cls = useCls();
|
|
374
|
-
const resizeObserverRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
375
|
-
const modalInnerRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((node)=>{
|
|
376
|
-
if (!node) return;
|
|
377
|
-
const modalBody = node.querySelector("." + cls("modal-body"));
|
|
378
|
-
if (!(modalBody instanceof HTMLElement)) return;
|
|
379
|
-
const resizeObserver = new ResizeObserver(()=>{
|
|
380
|
-
const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;
|
|
381
|
-
setIsContentOverflow(hasOverflow);
|
|
382
|
-
});
|
|
383
|
-
resizeObserverRef.current = resizeObserver;
|
|
384
|
-
resizeObserver.observe(modalBody);
|
|
385
|
-
const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;
|
|
386
|
-
setIsContentOverflow(hasOverflow);
|
|
387
|
-
}, [
|
|
388
|
-
cls
|
|
389
|
-
]);
|
|
390
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>()=>{
|
|
391
|
-
if (resizeObserverRef.current) {
|
|
392
|
-
resizeObserverRef.current.disconnect();
|
|
393
|
-
resizeObserverRef.current = null;
|
|
394
|
-
}
|
|
395
|
-
}, []);
|
|
396
|
-
const [locale] = (0, __WEBPACK_EXTERNAL_MODULE_antd_es_locale_31079002__.useLocale)("Modal", (0, __WEBPACK_EXTERNAL_MODULE_antd_es_modal_locale_f16c0933__.getConfirmLocale)());
|
|
397
|
-
const okTextLocale = okText || (null == locale ? void 0 : locale.okText);
|
|
398
|
-
const cancelTextLocale = cancelText || (null == locale ? void 0 : locale.cancelText);
|
|
399
|
-
const modalOkButtonProps = {
|
|
400
|
-
loading: loading,
|
|
401
|
-
...okButtonProps
|
|
402
|
-
};
|
|
403
|
-
const modalCancelButtonProps = {
|
|
404
|
-
...cancelButtonProps
|
|
405
|
-
};
|
|
406
|
-
const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(defaultOpen);
|
|
407
|
-
const uncontrolledOpen = void 0 === externalOpen;
|
|
408
|
-
const open = uncontrolledOpen ? internalOpen : externalOpen;
|
|
409
|
-
const defaultFooter = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_modal_context_bc73863f__.ModalContextProvider, {
|
|
410
|
-
value: {
|
|
411
|
-
okButtonProps: modalOkButtonProps,
|
|
412
|
-
cancelButtonProps: modalCancelButtonProps,
|
|
413
|
-
onCancel,
|
|
414
|
-
onOk,
|
|
415
|
-
okType,
|
|
416
|
-
confirmLoading,
|
|
417
|
-
okTextLocale,
|
|
418
|
-
cancelTextLocale
|
|
419
|
-
},
|
|
420
|
-
children: hideOkButton ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_modal_components_NormalCancelBtn_54ff398c__["default"], {}) : hideCancelButton ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_modal_components_NormalOkBtn_897b50c4__["default"], {}) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
|
|
421
|
-
children: [
|
|
422
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_modal_components_NormalCancelBtn_54ff398c__["default"], {}),
|
|
423
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_modal_components_NormalOkBtn_897b50c4__["default"], {})
|
|
424
|
-
]
|
|
425
|
-
})
|
|
426
|
-
});
|
|
427
|
-
const renderTitle = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
|
|
428
|
-
children: [
|
|
429
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(Stack_Stack, {
|
|
430
|
-
align: "center",
|
|
431
|
-
gap: 8,
|
|
432
|
-
className: cls("modal-title-wrapper"),
|
|
433
|
-
children: [
|
|
434
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Stack_Stack.Child, {
|
|
435
|
-
grow: true,
|
|
436
|
-
children: "string" == typeof title ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Truncate, {
|
|
437
|
-
children: title
|
|
438
|
-
}) : title
|
|
439
|
-
}),
|
|
440
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(Stack_Stack.Child, {
|
|
441
|
-
stack: true,
|
|
442
|
-
hug: true,
|
|
443
|
-
align: "center",
|
|
444
|
-
children: [
|
|
445
|
-
beforeCloseButton,
|
|
446
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(IconButton, {
|
|
447
|
-
onClick: (e)=>null == onCancel ? void 0 : onCancel(e),
|
|
448
|
-
children: defaultCloseIcon
|
|
449
|
-
}),
|
|
450
|
-
afterCloseButton
|
|
451
|
-
]
|
|
452
|
-
})
|
|
453
|
-
]
|
|
454
|
-
}),
|
|
455
|
-
afterTitle ? afterTitle : null
|
|
456
|
-
]
|
|
457
|
-
});
|
|
458
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_modal_52965d33__["default"], {
|
|
459
|
-
closeIcon: false,
|
|
460
|
-
open: open,
|
|
461
|
-
width: modalWidth,
|
|
462
|
-
style: modalStyle,
|
|
463
|
-
title: renderTitle(),
|
|
464
|
-
classNames: {
|
|
465
|
-
...classNames,
|
|
466
|
-
wrapper: cls("modal-wrap", "fullscreen" == size && "modal-fullscreen", isContentOverflow && "modal-content-overflow", false === bodyScrollable && "modal-no-body-scroll", defaultFixedHeaderFooter || isContentOverflow || "fullscreen" == size ? "modal-fixed" : "")
|
|
467
|
-
},
|
|
468
|
-
styles: modalStyles,
|
|
469
|
-
modalRender: (modal)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
470
|
-
ref: modalInnerRef,
|
|
471
|
-
className: cls("modal-inner"),
|
|
472
|
-
children: modal
|
|
473
|
-
}),
|
|
474
|
-
okButtonProps: modalOkButtonProps,
|
|
475
|
-
cancelButtonProps: modalCancelButtonProps,
|
|
476
|
-
onOk: (e)=>{
|
|
477
|
-
if (uncontrolledOpen) setInternalOpen(false);
|
|
478
|
-
null == onOk || onOk(e);
|
|
479
|
-
},
|
|
480
|
-
onCancel: (e)=>{
|
|
481
|
-
if (uncontrolledOpen) setInternalOpen(false);
|
|
482
|
-
null == onCancel || onCancel(e);
|
|
483
|
-
},
|
|
484
|
-
okText: okText,
|
|
485
|
-
cancelText: cancelText,
|
|
486
|
-
okType: "primary",
|
|
487
|
-
confirmLoading: confirmLoading,
|
|
488
|
-
footer: void 0 === footer ? hideOkButton && hideCancelButton ? null : defaultFooter : footer,
|
|
489
|
-
centered: centered,
|
|
490
|
-
...rest,
|
|
491
|
-
children: children
|
|
492
|
-
});
|
|
493
|
-
};
|
|
494
|
-
function _define_property(obj, key, value) {
|
|
495
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
496
|
-
value: value,
|
|
497
|
-
enumerable: true,
|
|
498
|
-
configurable: true,
|
|
499
|
-
writable: true
|
|
500
|
-
});
|
|
501
|
-
else obj[key] = value;
|
|
502
|
-
return obj;
|
|
503
|
-
}
|
|
504
|
-
class ModalManager {
|
|
505
|
-
subscribe(listener) {
|
|
506
|
-
this.listeners.push(listener);
|
|
507
|
-
return ()=>{
|
|
508
|
-
this.listeners = this.listeners.filter((l)=>l !== listener);
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
emit(event) {
|
|
512
|
-
this.listeners.forEach((l)=>l(event));
|
|
513
|
-
}
|
|
514
|
-
generateId() {
|
|
515
|
-
this.counter += 1;
|
|
516
|
-
return `modal_${this.counter}_${Date.now()}`;
|
|
517
|
-
}
|
|
518
|
-
constructor(){
|
|
519
|
-
_define_property(this, "listeners", []);
|
|
520
|
-
_define_property(this, "counter", 0);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const modalManager = new ModalManager();
|
|
524
|
-
function createModal(config) {
|
|
525
|
-
const trigger = document.activeElement instanceof HTMLElement ? document.activeElement : void 0;
|
|
526
|
-
const { type = "default", ...restConfig } = config;
|
|
527
|
-
const id = modalManager.generateId();
|
|
528
|
-
modalManager.emit({
|
|
529
|
-
type: "add",
|
|
530
|
-
payload: {
|
|
531
|
-
id,
|
|
532
|
-
type,
|
|
533
|
-
trigger,
|
|
534
|
-
...restConfig
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
return {
|
|
538
|
-
update: (cfg)=>modalManager.emit({
|
|
539
|
-
type: "update",
|
|
540
|
-
payload: {
|
|
541
|
-
id,
|
|
542
|
-
config: cfg
|
|
543
|
-
}
|
|
544
|
-
}),
|
|
545
|
-
destroy: ()=>modalManager.emit({
|
|
546
|
-
type: "destroy",
|
|
547
|
-
payload: {
|
|
548
|
-
id
|
|
549
|
-
}
|
|
550
|
-
})
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
const functions_confirm = (config)=>createModal({
|
|
554
|
-
...config,
|
|
555
|
-
type: "confirm"
|
|
556
|
-
});
|
|
557
|
-
const info = (config)=>createModal({
|
|
558
|
-
...config,
|
|
559
|
-
type: "info"
|
|
560
|
-
});
|
|
561
|
-
const success = (config)=>createModal({
|
|
562
|
-
...config,
|
|
563
|
-
type: "success"
|
|
564
|
-
});
|
|
565
|
-
const error = (config)=>createModal({
|
|
566
|
-
...config,
|
|
567
|
-
type: "error"
|
|
568
|
-
});
|
|
569
|
-
const warning = (config)=>createModal({
|
|
570
|
-
...config,
|
|
571
|
-
type: "warning"
|
|
572
|
-
});
|
|
573
|
-
const functions_open = (config)=>createModal({
|
|
574
|
-
...config,
|
|
575
|
-
type: "default"
|
|
576
|
-
});
|
|
577
|
-
const destroyAll = ()=>modalManager.emit({
|
|
578
|
-
type: "destroyAll"
|
|
579
|
-
});
|
|
580
|
-
"use client";
|
|
581
|
-
const ModalProvider = ({ children })=>{
|
|
582
|
-
const [modals, setModals] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)([]);
|
|
583
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
584
|
-
const unsubscribe = modalManager.subscribe((event)=>{
|
|
585
|
-
setModals((prev)=>{
|
|
586
|
-
switch(event.type){
|
|
587
|
-
case "add":
|
|
588
|
-
return [
|
|
589
|
-
...prev,
|
|
590
|
-
event.payload
|
|
591
|
-
];
|
|
592
|
-
case "update":
|
|
593
|
-
return prev.map((m)=>{
|
|
594
|
-
if (m.id === event.payload.id) {
|
|
595
|
-
const cfg = event.payload.config;
|
|
596
|
-
const merged = "function" == typeof cfg ? cfg(m) : {
|
|
597
|
-
...m,
|
|
598
|
-
...cfg
|
|
599
|
-
};
|
|
600
|
-
return {
|
|
601
|
-
...m,
|
|
602
|
-
...merged
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
return m;
|
|
606
|
-
});
|
|
607
|
-
case "destroy":
|
|
608
|
-
return prev.filter((m)=>m.id !== event.payload.id);
|
|
609
|
-
case "destroyAll":
|
|
610
|
-
return [];
|
|
611
|
-
default:
|
|
612
|
-
return prev;
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
|
-
return unsubscribe;
|
|
617
|
-
}, []);
|
|
618
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
|
|
619
|
-
children: [
|
|
620
|
-
children,
|
|
621
|
-
modals.map((modal)=>{
|
|
622
|
-
const { id, content, children, onOk, onCancel, trigger, ...modalProps } = modal;
|
|
623
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createElement)(Modal, {
|
|
624
|
-
...modalProps,
|
|
625
|
-
key: id,
|
|
626
|
-
open: modalProps.open,
|
|
627
|
-
onOk: (e)=>{
|
|
628
|
-
null == onOk || onOk(e);
|
|
629
|
-
modalManager.emit({
|
|
630
|
-
type: "update",
|
|
631
|
-
payload: {
|
|
632
|
-
id,
|
|
633
|
-
config: {
|
|
634
|
-
open: false
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
},
|
|
639
|
-
onCancel: (e)=>{
|
|
640
|
-
null == onCancel || onCancel(e);
|
|
641
|
-
modalManager.emit({
|
|
642
|
-
type: "update",
|
|
643
|
-
payload: {
|
|
644
|
-
id,
|
|
645
|
-
config: {
|
|
646
|
-
open: false
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
},
|
|
651
|
-
afterClose: ()=>{
|
|
652
|
-
modalManager.emit({
|
|
653
|
-
type: "destroy",
|
|
654
|
-
payload: {
|
|
655
|
-
id
|
|
656
|
-
}
|
|
657
|
-
});
|
|
658
|
-
if (trigger instanceof HTMLElement) trigger.focus();
|
|
659
|
-
}
|
|
660
|
-
}, content || children);
|
|
661
|
-
})
|
|
662
|
-
]
|
|
663
|
-
});
|
|
664
|
-
};
|
|
665
|
-
const useModal = ()=>(0, __WEBPACK_EXTERNAL_MODULE_antd_es_app_useApp_90d95086__["default"])().modal;
|
|
666
|
-
const Modal_Modal = Object.assign(Modal, {
|
|
667
|
-
Provider: ModalProvider,
|
|
668
|
-
open: functions_open,
|
|
669
|
-
info: info,
|
|
670
|
-
success: success,
|
|
671
|
-
error: error,
|
|
672
|
-
warning: warning,
|
|
673
|
-
confirm: functions_confirm,
|
|
674
|
-
destroyAll: destroyAll,
|
|
675
|
-
useModal
|
|
676
|
-
});
|
|
677
|
-
export { Modal_Modal as Modal };
|
package/dist/Popover.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd_es_popover_ff5d0161__ from "antd/es/popover";
|
|
3
|
-
"use client";
|
|
4
|
-
const Popover = ({ className, style, arrow = false, ...rest })=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd_es_popover_ff5d0161__["default"], {
|
|
5
|
-
className: className,
|
|
6
|
-
arrow: arrow,
|
|
7
|
-
style: style,
|
|
8
|
-
...rest
|
|
9
|
-
});
|
|
10
|
-
export { Popover };
|