@para-ui/core 4.0.54 → 4.0.56

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.
Files changed (72) hide show
  1. package/Argv/index.js +5 -4
  2. package/AutoButton/index.d.ts +3 -0
  3. package/AutoButton/index.js +30 -14
  4. package/Button/SplitButton.d.ts +5 -0
  5. package/Button/index.d.ts +4 -0
  6. package/Button/index.js +17 -352
  7. package/ButtonGroup/index.js +5 -1
  8. package/ComboSelect/index.js +9 -9
  9. package/CycleSelector/index.js +3 -1
  10. package/DatePicker/index.js +6 -3
  11. package/Descriptions/index.js +5 -1
  12. package/Desktop/index.js +4 -1
  13. package/Drawer/index.js +5 -1
  14. package/DynamicMultiBox/index.js +8 -8
  15. package/FieldForm/FieldFormItem/index.d.ts +1 -0
  16. package/FieldForm/FormItemInput.d.ts +2 -0
  17. package/FieldForm/index.js +15 -7
  18. package/Form/index.js +8 -8
  19. package/FormItem/index.js +8 -8
  20. package/FunctionModal/index.js +7 -6
  21. package/InputCode/index.js +4 -1
  22. package/Modal/index.js +2 -1
  23. package/OperateBtn/index.js +5 -6
  24. package/PageHeader/index.js +5 -1
  25. package/Pagination/index.js +4 -1
  26. package/PopConfirm/index.js +14 -213
  27. package/QuickReply/index.js +6 -7
  28. package/README.md +14 -0
  29. package/Selector/index.js +3 -2
  30. package/Stepper/index.js +1 -1
  31. package/Table/index.js +502 -488
  32. package/Tabs/index.js +6 -7
  33. package/TimePicker/index.js +5 -2
  34. package/ToggleButton/index.js +5 -1
  35. package/Transfer/index.js +5 -2
  36. package/Upload/index.js +3 -4
  37. package/_verture/{index-43c653bb.js → index-7558fb61.js} +1 -1
  38. package/_verture/index-cd9ede02.js +596 -0
  39. package/_verture/useResizeObserver-960e470e.js +54 -0
  40. package/index.js +9 -9
  41. package/package.json +1 -1
  42. package/umd/Argv.js +4 -4
  43. package/umd/AutoButton.js +7 -7
  44. package/umd/Button.js +7 -7
  45. package/umd/ButtonGroup.js +7 -7
  46. package/umd/ComboSelect.js +1 -1
  47. package/umd/CycleSelector.js +5 -5
  48. package/umd/DatePicker.js +5 -5
  49. package/umd/Descriptions.js +7 -7
  50. package/umd/Desktop.js +5 -5
  51. package/umd/Drawer.js +7 -7
  52. package/umd/DynamicMultiBox.js +1 -1
  53. package/umd/FieldForm.js +2 -2
  54. package/umd/Form.js +1 -1
  55. package/umd/FormItem.js +1 -1
  56. package/umd/FunctionModal.js +7 -7
  57. package/umd/InputCode.js +6 -6
  58. package/umd/Modal.js +5 -5
  59. package/umd/OperateBtn.js +6 -6
  60. package/umd/PageHeader.js +7 -7
  61. package/umd/Pagination.js +5 -5
  62. package/umd/PopConfirm.js +2 -2
  63. package/umd/QuickReply.js +1 -1
  64. package/umd/Selector.js +1 -1
  65. package/umd/SelectorPicker.js +1 -1
  66. package/umd/Table.js +1 -1
  67. package/umd/Tabs.js +1 -1
  68. package/umd/TimePicker.js +5 -5
  69. package/umd/ToggleButton.js +7 -7
  70. package/umd/Transfer.js +8 -8
  71. package/umd/Upload.js +1 -1
  72. /package/_verture/{modalContext-6ac2e323.js → modalContext-ce07f2de.js} +0 -0
package/Argv/index.js CHANGED
@@ -5,7 +5,7 @@ import clsx from 'clsx';
5
5
  import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
6
6
  import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
7
7
  import { UUID, debounce } from '@paraview/lib';
8
- import { Button } from '../Button/index.js';
8
+ import { B as Button } from '../_verture/index-cd9ede02.js';
9
9
  import { TextField } from '../TextField/index.js';
10
10
  import { Modal } from '../Modal/index.js';
11
11
  import { Message } from '../Message/index.js';
@@ -29,17 +29,18 @@ import 'rc-dropdown';
29
29
  import '../_verture/usePopupContainer-635f66f4.js';
30
30
  import 'dayjs';
31
31
  import '../AutoTips/index.js';
32
+ import '@para-ui/icons/CheckCircleF';
33
+ import '@para-ui/icons/WarningCircle';
34
+ import '@para-ui/icons/CloseCircleF';
35
+ import '@para-ui/icons/WarningCircleF';
32
36
  import '@para-ui/icons/PreviewClose';
33
37
  import '@para-ui/icons/PreviewOpen';
34
- import '@para-ui/icons/CloseCircleF';
35
38
  import '../Loading/index.js';
36
39
  import '../HelperText/index.js';
37
40
  import '../_verture/useGlobalProps-4ae1a007.js';
38
41
  import 'rc-dialog';
39
42
  import '@para-ui/icons/Close';
40
43
  import 'react-dom';
41
- import '@para-ui/icons/CheckCircleF';
42
- import '@para-ui/icons/WarningCircleF';
43
44
  import '../Empty/index.js';
44
45
  import '@para-ui/icons/Check';
45
46
  import '@para-ui/icons/Search';
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import React, { FunctionComponent, ReactNode } from 'react';
7
7
  import { ButtonProps, IconButtonProps } from '../Button';
8
+ import { PopConfirmProps } from '../PopConfirm';
8
9
  import { SplitButtonProps } from "../Button/SplitButton";
9
10
  import { Placement } from '../Dropdown';
10
11
  import './index.scss';
@@ -12,6 +13,8 @@ type TypeAutoButtonItemProps = ButtonProps | IconButtonProps | SplitButtonProps;
12
13
  interface AutoButtonItemOtherProps {
13
14
  /** 不传就是正常的按钮 */
14
15
  buttonType?: 'icon' | 'split';
16
+ /** 气泡确认框参数 */
17
+ popConfirmProps?: PopConfirmProps;
15
18
  }
16
19
  export type AutoButtonItemProps = TypeAutoButtonItemProps & AutoButtonItemOtherProps;
17
20
  export interface AutoButtonProps {
@@ -1,7 +1,7 @@
1
1
  import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useState, useRef, useEffect, Fragment } from 'react';
4
- import { Button } from '../Button/index.js';
4
+ import { B as Button, P as PopConfirm } from '../_verture/index-cd9ede02.js';
5
5
  import AutoTips from '../AutoTips/index.js';
6
6
  import MoreVert from '@para-ui/icons/MoreVert';
7
7
  import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
@@ -9,12 +9,17 @@ import { D as Dropdown } from '../_verture/index-bde7aabe.js';
9
9
  import { Tooltip } from '../Tooltip/index.js';
10
10
  import clsx from 'clsx';
11
11
  import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
12
+ import { u as useResizeObserver } from '../_verture/useResizeObserver-960e470e.js';
12
13
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
13
14
  import '@para-ui/icons/LoadingF';
14
15
  import '@para-ui/icons/Down';
16
+ import '@para-ui/icons/CheckCircleF';
17
+ import '@para-ui/icons/WarningCircle';
18
+ import '@para-ui/icons/CloseCircleF';
19
+ import '@para-ui/icons/WarningCircleF';
20
+ import '../_verture/usePopupContainer-635f66f4.js';
15
21
  import '@paraview/lib';
16
22
  import 'rc-dropdown';
17
- import '../_verture/usePopupContainer-635f66f4.js';
18
23
  import 'dayjs';
19
24
  import 'rc-tooltip';
20
25
  import 'rc-tooltip/lib/placements';
@@ -55,13 +60,12 @@ const AutoButton = props => {
55
60
  const constData = useRef({
56
61
  timer: null
57
62
  });
63
+ useResizeObserver({
64
+ dom: comRef.current,
65
+ cb: () => changeSize()
66
+ });
58
67
  useEffect(() => {
59
68
  changeSize();
60
- window.addEventListener('resize', changeSize);
61
- return () => {
62
- window.removeEventListener('resize', changeSize);
63
- clearTimeout(constData.current.timer);
64
- };
65
69
  }, [list]);
66
70
  const changeSize = () => {
67
71
  clearTimeout(constData.current.timer);
@@ -133,13 +137,13 @@ const AutoButton = props => {
133
137
  if (morePos !== null && morePos > index) return null;
134
138
  if (item.buttonType !== 'split') {
135
139
  return jsx(Fragment, {
136
- children: renderMoreItem(item, 'children')
140
+ children: handlePopConfirm(item, renderMoreItem(item, 'children'))
137
141
  }, index);
138
142
  }
139
143
  return jsx(Fragment, {
140
144
  children: (_a = item.options) === null || _a === void 0 ? void 0 : _a.map((itemChild, inx) => {
141
145
  return jsx(Fragment, {
142
- children: renderMoreItem(itemChild, 'label', item)
146
+ children: handlePopConfirm(itemChild, renderMoreItem(itemChild, 'label', item))
143
147
  }, index + '-' + inx);
144
148
  })
145
149
  }, index);
@@ -180,6 +184,15 @@ const AutoButton = props => {
180
184
  children: Dom
181
185
  }));
182
186
  };
187
+ /** 处理PopConfirm内容 */
188
+ const handlePopConfirm = (item, children) => {
189
+ if (item.popConfirmProps) {
190
+ return jsx(PopConfirm, Object.assign({}, item.popConfirmProps, {
191
+ children: children
192
+ }));
193
+ }
194
+ return children;
195
+ };
183
196
  return jsxs("div", Object.assign({
184
197
  className: clsx(className, "".concat($prefixCls, "-auto-button")),
185
198
  style: style,
@@ -188,9 +201,10 @@ const AutoButton = props => {
188
201
  children: [list.map((item, index) => {
189
202
  if (morePos !== null && morePos <= index) return null;
190
203
  const {
191
- buttonType
204
+ buttonType,
205
+ popConfirmProps
192
206
  } = item,
193
- otherItemProps = __rest(item, ["buttonType"]);
207
+ otherItemProps = __rest(item, ["buttonType", "popConfirmProps"]);
194
208
  let Dom = Button;
195
209
  const styleItem = {
196
210
  marginRight: morePos === index + 1 ? 0 : marginRight
@@ -203,9 +217,11 @@ const AutoButton = props => {
203
217
  if (buttonType === 'split') {
204
218
  Dom = Button.SplitButton;
205
219
  }
206
- return jsx(Dom, Object.assign({}, otherItemProps, {
207
- style: styleItem
208
- }), index);
220
+ return jsx(Fragment, {
221
+ children: handlePopConfirm(item, jsx(Dom, Object.assign({}, otherItemProps, {
222
+ style: styleItem
223
+ })))
224
+ }, index);
209
225
  }), handleMoreBtn()]
210
226
  }));
211
227
  };
@@ -8,6 +8,7 @@ import { ButtonProps } from '../Button';
8
8
  import { Placement } from '../Dropdown';
9
9
  import { AutoTipsProps } from '../AutoTips';
10
10
  import { TooltipProps } from '../Tooltip';
11
+ import { PopConfirmProps } from '../PopConfirm';
11
12
  import './index.scss';
12
13
  interface Option {
13
14
  /**
@@ -26,6 +27,8 @@ interface Option {
26
27
  * 禁用提示
27
28
  */
28
29
  disabledTooltip?: TooltipProps;
30
+ /** 气泡确认框参数 */
31
+ popConfirmProps?: PopConfirmProps;
29
32
  [name: string]: any;
30
33
  }
31
34
  type GroupOption = Array<Option>;
@@ -57,6 +60,8 @@ export interface SplitButtonProps {
57
60
  placement?: Placement;
58
61
  /** button props */
59
62
  buttonProps?: ButtonProps;
63
+ /** 前置图标 */
64
+ startIcon?: React.ReactNode;
60
65
  /**
61
66
  * click callback
62
67
  * @param option
package/Button/index.d.ts CHANGED
@@ -39,6 +39,8 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<any> {
39
39
  href?: string;
40
40
  /** target */
41
41
  target?: string;
42
+ /** 禁用提示 */
43
+ disabledTooltip?: TooltipProps;
42
44
  [name: string]: any;
43
45
  }
44
46
  export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
@@ -67,6 +69,8 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
67
69
  href?: string;
68
70
  /** target */
69
71
  target?: string;
72
+ /** 禁用提示 */
73
+ disabledTooltip?: TooltipProps;
70
74
  [name: string]: any;
71
75
  }
72
76
  declare const InternalButton: FunctionComponent<ButtonProps>;
package/Button/index.js CHANGED
@@ -1,360 +1,25 @@
1
- import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useRef, useState, useEffect } from 'react';
4
- import clsx from 'clsx';
5
- import LoadingOutlined from '@para-ui/icons/LoadingF';
6
- import { Tooltip } from '../Tooltip/index.js';
7
- import Down from '@para-ui/icons/Down';
8
- import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
9
- import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
10
- import { D as Dropdown } from '../_verture/index-bde7aabe.js';
11
- import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
12
- import AutoTips from '../AutoTips/index.js';
1
+ import '../_verture/tslib.es6-55ed4bd2.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+ import 'clsx';
5
+ import '@para-ui/icons/LoadingF';
6
+ import '../Tooltip/index.js';
7
+ export { B as Button, B as default } from '../_verture/index-cd9ede02.js';
8
+ import '../_verture/constant-5317fc89.js';
13
9
  import 'rc-tooltip';
14
10
  import 'rc-tooltip/lib/placements';
15
11
  import '@para-ui/icons/Forbid';
12
+ import '../_verture/style-inject.es-300983ab.js';
13
+ import '@para-ui/icons/Down';
14
+ import '../_verture/index-bde7aabe.js';
16
15
  import 'rc-dropdown';
17
16
  import '../_verture/usePopupContainer-635f66f4.js';
18
17
  import 'dayjs';
19
18
  import '@paraview/lib';
19
+ import '../_verture/useFormatMessage-1fc7c957.js';
20
20
  import '../_verture/index-ca413216.js';
21
-
22
- var en = {
23
- moreActions: 'More actions'
24
- };
25
-
26
- var zh = {
27
- moreActions: '更多操作'
28
- };
29
-
30
- var localeJson = {
31
- zh: zh,
32
- en: en
33
- };
34
-
35
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/21 下午5:16\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n@keyframes buttonLoadingSpin {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.paraui-v4-button {\n border: 0;\n cursor: pointer;\n display: inline-flex;\n outline: 0;\n position: relative;\n align-items: center;\n user-select: none;\n vertical-align: middle;\n justify-content: center;\n text-decoration: none;\n background-color: transparent;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n padding: 0 10px;\n line-height: 1.5715;\n border-radius: 4px;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n white-space: nowrap;\n color: rgb(255, 255, 255);\n box-sizing: border-box;\n letter-spacing: 0.02857em;\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.paraui-v4-button .button-label {\n width: 100%;\n display: inherit;\n align-items: inherit;\n justify-content: inherit;\n}\n.paraui-v4-button .button-icon {\n display: inherit;\n margin-right: 4px;\n}\n.paraui-v4-button .button-icon svg {\n color: inherit;\n font-weight: 500;\n}\n.paraui-v4-button .button-icon-end {\n margin-right: 0;\n margin-left: 4px;\n}\n.paraui-v4-button .button-icon-loading {\n animation: buttonLoadingSpin 1s infinite linear;\n}\n.paraui-v4-button-loading {\n pointer-events: none;\n}\n.paraui-v4-button-contained {\n color: rgb(255, 255, 255);\n background-color: rgb(46, 101, 230);\n border: 1px solid rgb(46, 101, 230);\n}\n.paraui-v4-button-contained:hover {\n background-color: rgb(87, 131, 235);\n border: 1px solid rgba(255, 255, 255, 0);\n}\n.paraui-v4-button-contained.paraui-v4-button-link-disabled {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-button-contained.paraui-v4-button-link-disabled:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-contained[disabled] {\n color: rgb(92, 101, 115);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-button-contained[disabled]:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-contained.paraui-v4-button-dangerous {\n background-color: rgb(244, 66, 66);\n border: 1px solid rgb(244, 66, 66);\n}\n.paraui-v4-button-contained.paraui-v4-button-dangerous:hover {\n background-color: rgb(246, 103, 103);\n border: 1px solid rgba(255, 255, 255, 0);\n}\n.paraui-v4-button-outlined {\n color: rgb(29, 33, 38);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-button-outlined:hover {\n color: rgb(46, 101, 230);\n border-color: rgb(87, 131, 235);\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-button-outlined.paraui-v4-button-link-disabled {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-button-outlined.paraui-v4-button-link-disabled:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-outlined[disabled] {\n color: rgb(92, 101, 115);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-button-outlined[disabled]:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-outlined.paraui-v4-button-dangerous {\n color: rgb(244, 66, 66);\n border-color: rgb(244, 66, 66);\n}\n.paraui-v4-button-outlined.paraui-v4-button-dangerous:hover {\n color: rgb(244, 66, 66);\n border-color: rgb(246, 103, 103);\n}\n.paraui-v4-button-text {\n color: rgb(46, 101, 230);\n background-color: transparent;\n border: none;\n padding: unset;\n margin: 0 10px;\n}\n.paraui-v4-button-text:hover {\n color: rgb(87, 131, 235);\n background-color: transparent;\n}\n.paraui-v4-button-text.paraui-v4-button-link-disabled {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-button-text.paraui-v4-button-link-disabled:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-text[disabled] {\n color: rgb(92, 101, 115);\n background-color: transparent;\n border: none;\n cursor: not-allowed;\n}\n.paraui-v4-button-text[disabled]:hover {\n background-color: transparent;\n}\n.paraui-v4-button-text.paraui-v4-button-dangerous {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-button-text.paraui-v4-button-dangerous:hover {\n color: rgb(246, 103, 103);\n}\n.paraui-v4-button-large {\n height: 32px;\n}\n.paraui-v4-button-medium {\n height: 28px;\n}\n.paraui-v4-button-small {\n height: 28px;\n}\n.paraui-v4-button--disabled {\n display: inline-block;\n cursor: not-allowed;\n}\n.paraui-v4-button--disabled button {\n pointer-events: none;\n}\n\n.paraui-v4-icon-button {\n flex: 0 0 auto;\n overflow: visible;\n text-align: center;\n transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n padding: 0;\n border-radius: 4px;\n}\n.paraui-v4-icon-button-loading {\n pointer-events: none;\n}\n.paraui-v4-icon-button-loading .button-loading-icon {\n display: inline-flex;\n animation: buttonLoadingSpin 1s infinite linear;\n}\n.paraui-v4-icon-button svg {\n color: inherit;\n font-size: 16px;\n}\n.paraui-v4-icon-button-contained {\n color: rgb(255, 255, 255);\n background-color: rgb(46, 101, 230);\n}\n.paraui-v4-icon-button-contained:hover {\n background-color: rgb(87, 131, 235);\n box-shadow: none;\n}\n.paraui-v4-icon-button-contained.paraui-v4-button-link-disabled {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-icon-button-contained.paraui-v4-button-link-disabled:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-icon-button-contained[disabled] {\n color: rgb(92, 101, 115);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-icon-button-contained[disabled]:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-icon-button-contained.paraui-v4-icon-button-dangerous {\n background-color: rgb(244, 66, 66);\n}\n.paraui-v4-icon-button-contained.paraui-v4-icon-button-dangerous:hover {\n background-color: rgb(246, 103, 103);\n}\n.paraui-v4-icon-button-outlined {\n color: rgb(29, 33, 38);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-icon-button-outlined:hover {\n color: rgb(46, 101, 230);\n border-color: rgb(87, 131, 235);\n box-shadow: none;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-icon-button-outlined.paraui-v4-button-link-disabled {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-icon-button-outlined.paraui-v4-button-link-disabled:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-icon-button-outlined[disabled] {\n color: rgb(92, 101, 115);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-icon-button-outlined[disabled]:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-icon-button-outlined.paraui-v4-icon-button-dangerous {\n color: rgb(244, 66, 66);\n border-color: rgb(244, 66, 66);\n}\n.paraui-v4-icon-button-outlined.paraui-v4-icon-button-dangerous:hover {\n color: rgb(244, 66, 66);\n border-color: rgb(246, 103, 103);\n}\n.paraui-v4-icon-button-text {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-icon-button-text:hover {\n color: rgb(87, 131, 235);\n background-color: transparent;\n}\n.paraui-v4-icon-button-text.paraui-v4-button-link-disabled {\n pointer-events: none;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-icon-button-text.paraui-v4-button-link-disabled:hover {\n background-color: transparent;\n}\n.paraui-v4-icon-button-text[disabled] {\n color: rgb(161, 168, 179);\n pointer-events: none;\n}\n.paraui-v4-icon-button-text[disabled]:hover {\n background-color: transparent;\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-dangerous {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-dangerous:hover {\n color: rgb(246, 103, 103);\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-large {\n width: auto;\n height: auto;\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-large svg {\n font-size: 24px;\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-medium {\n width: auto;\n height: auto;\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-medium svg {\n font-size: 20px;\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-small {\n width: auto;\n height: auto;\n}\n.paraui-v4-icon-button-text.paraui-v4-icon-button-small svg {\n font-size: 20px;\n}\n.paraui-v4-icon-button-activate {\n color: rgb(29, 33, 38);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(212, 218, 227);\n color: rgb(46, 101, 230);\n border-color: rgb(46, 101, 230);\n box-shadow: none;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-icon-button-activate.paraui-v4-button-link-disabled {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-icon-button-activate.paraui-v4-button-link-disabled:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-icon-button-activate[disabled] {\n color: rgb(92, 101, 115);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-icon-button-activate[disabled]:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-icon-button-activate.paraui-v4-icon-button-dangerous {\n color: rgb(244, 66, 66);\n border-color: rgb(244, 66, 66);\n}\n.paraui-v4-icon-button-activate.paraui-v4-icon-button-dangerous:hover {\n color: rgb(244, 66, 66);\n border-color: rgb(246, 103, 103);\n}\n.paraui-v4-icon-button-large {\n width: 32px;\n height: 32px;\n}\n.paraui-v4-icon-button-medium {\n width: 28px;\n height: 28px;\n}\n.paraui-v4-icon-button-small {\n width: 28px;\n height: 28px;\n}\n\n.paraui-v4-button-split {\n display: inline-block;\n}\n.paraui-v4-button-split .paraui-v4-button-split--active {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-button-split-list {\n padding: 4px 0;\n border-radius: 4px;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-button-split-list ul .split-li {\n padding: 5px 10px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n line-height: 20px;\n cursor: pointer;\n transition: background-color 0.3s, color 0.3s;\n white-space: nowrap;\n}\n.paraui-v4-button-split-list ul .split-li:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-split-list ul .split-li.split-li--active {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-button-split-list ul .split-li.split-li--active:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-split-list ul .split-li.split-li--hover:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-button-split-list ul .split-li.split-li--disabled {\n color: rgb(161, 168, 179);\n cursor: not-allowed;\n}\n.paraui-v4-button-split-list ul .split-li.split-li--disabled:hover {\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-button-split-list ul .split-li-group:not(:first-child) {\n position: relative;\n margin-top: 8px;\n}\n.paraui-v4-button-split-list ul .split-li-group:not(:first-child):before {\n content: \"\";\n position: absolute;\n top: -4px;\n left: 8px;\n right: 8px;\n border-top: 1px solid rgb(234, 236, 241);\n}";
36
- styleInject(css_248z);
37
-
38
- //分体式按钮
39
- function SplitButton(props) {
40
- const {
41
- buttonText,
42
- options = [],
43
- className,
44
- style,
45
- disabled = false,
46
- onClick,
47
- optionRender,
48
- placement = 'bottomLeft',
49
- buttonProps,
50
- iconButton = false,
51
- popperStyle,
52
- popperClassName = '',
53
- getPopupContainer,
54
- variant,
55
- hideStartIcon,
56
- optionMaxWidth = '500px',
57
- optionTipsPlacement = 'top-start'
58
- } = props;
59
- const intl = useFormatMessage('Button', localeJson);
60
- const btnRef = useRef();
61
- // const [selectedIndex, setSelectedIndex] = useState<number | string>();
62
- // button click
63
- const handleButtonClick = (opt, index, event) => {
64
- var _a;
65
- if (opt.disabled) {
66
- event.stopPropagation();
67
- return;
68
- }
69
- // setSelectedIndex(index);
70
- (_a = btnRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove("".concat($prefixCls, "-button-split--active"));
71
- onClick === null || onClick === void 0 ? void 0 : onClick(opt, event);
72
- };
73
- //渲染按钮列表
74
- const renderButtonList = () => {
75
- // 渲染item
76
- const renderItem = item => {
77
- const com = (optionRender === null || optionRender === void 0 ? void 0 : optionRender(item)) || jsx(AutoTips, Object.assign({
78
- placement: optionTipsPlacement
79
- }, {
80
- children: item.label
81
- }));
82
- const {
83
- disabled,
84
- disabledTooltip
85
- } = item;
86
- if (disabled && disabledTooltip) {
87
- return jsx(Tooltip, Object.assign({
88
- disabled: true
89
- }, disabledTooltip, {
90
- children: (optionRender === null || optionRender === void 0 ? void 0 : optionRender(item)) || item.label
91
- }));
92
- }
93
- return com;
94
- };
95
- //分组列表
96
- const generateLiGroup = (opt, index) => {
97
- return jsx("li", Object.assign({
98
- className: 'split-li-group'
99
- }, {
100
- children: opt.map((gItem, gIndex) => {
101
- const idx = "".concat(index, "-").concat(gIndex);
102
- return jsx("div", Object.assign({
103
- className: clsx('split-li',
104
- // idx === selectedIndex && 'split-li--active',
105
- gItem.disabled ? 'split-li--disabled' : 'split-li--hover'),
106
- style: {
107
- maxWidth: optionMaxWidth
108
- },
109
- onClick: evt => handleButtonClick(gItem, idx, evt)
110
- }, {
111
- children: renderItem(gItem)
112
- }), idx);
113
- })
114
- }), index);
115
- };
116
- return jsx("div", Object.assign({
117
- className: "".concat($prefixCls, "-button-split-list")
118
- }, {
119
- children: jsx("ul", {
120
- children: options.map((opt, index) => {
121
- if (Array.isArray(opt)) {
122
- //分组
123
- return generateLiGroup(opt, index);
124
- }
125
- return jsx("li", Object.assign({
126
- className: clsx('split-li',
127
- // index === selectedIndex && 'split-li--active',
128
- opt.disabled ? 'split-li--disabled' : 'split-li--hover'),
129
- style: {
130
- maxWidth: optionMaxWidth
131
- },
132
- onClick: evt => handleButtonClick(opt, index, evt)
133
- }, {
134
- children: renderItem(opt)
135
- }), index);
136
- })
137
- })
138
- }));
139
- };
140
- //渲染button
141
- const renderButton = () => {
142
- if (iconButton) {
143
- if (variant) {
144
- return jsx(Button.IconButton, Object.assign({
145
- variant: variant,
146
- size: 'small',
147
- disabled: disabled
148
- }, buttonProps, {
149
- children: buttonText !== null && buttonText !== void 0 ? buttonText : intl({
150
- id: 'moreActions'
151
- })
152
- }));
153
- }
154
- return jsx(Button.IconButton, Object.assign({
155
- variant: 'text',
156
- size: 'small',
157
- disabled: disabled
158
- }, buttonProps, {
159
- children: buttonText !== null && buttonText !== void 0 ? buttonText : intl({
160
- id: 'moreActions'
161
- })
162
- }));
163
- }
164
- return jsx(Button, Object.assign({
165
- variant: variant || 'outlined',
166
- size: 'large',
167
- startIcon: hideStartIcon ? null : jsx(Down, {}),
168
- disabled: disabled
169
- }, buttonProps, {
170
- children: buttonText !== null && buttonText !== void 0 ? buttonText : intl({
171
- id: 'moreActions'
172
- })
173
- }));
174
- };
175
- return jsx("div", Object.assign({
176
- className: clsx("".concat($prefixCls, "-button-split"), className),
177
- style: style
178
- }, {
179
- children: jsx(Dropdown, Object.assign({
180
- overlay: renderButtonList(),
181
- placement: placement,
182
- overlayStyle: popperStyle,
183
- overlayClassName: popperClassName,
184
- getPopupContainer: getPopupContainer
185
- }, {
186
- children: renderButton()
187
- }))
188
- }));
189
- }
190
-
191
- //按钮
192
- const InternalButton = props => {
193
- const {
194
- variant = 'contained',
195
- size = 'large',
196
- className,
197
- disabled = false,
198
- children,
199
- startIcon,
200
- endIcon,
201
- loading = false,
202
- toolTipTitle = '',
203
- TooltipProps,
204
- danger = false,
205
- href,
206
- target
207
- } = props,
208
- restProps = __rest(props, ["variant", "size", "className", "disabled", "children", "startIcon", "endIcon", "loading", "toolTipTitle", "TooltipProps", "danger", "href", "target"]);
209
- const [hasLoading, setHasLoading] = useState(false);
210
- const isLinkBtn = ('href' in props);
211
- //cls
212
- const makeCls = () => {
213
- return clsx("".concat($prefixCls, "-button"), className, "".concat($prefixCls, "-button-").concat(variant), "".concat($prefixCls, "-button-").concat(size), hasLoading && "".concat($prefixCls, "-button-loading"), danger && !disabled && "".concat($prefixCls, "-button-dangerous"), isLinkBtn && "".concat($prefixCls, "-button-link"), isLinkBtn && disabled && "".concat($prefixCls, "-button-link-disabled"));
214
- };
215
- //渲染按钮图标
216
- const renderBtnIcon = pos => {
217
- if (!hasLoading) {
218
- if (pos === 'start' && startIcon) return jsx("span", Object.assign({
219
- className: 'button-icon'
220
- }, {
221
- children: startIcon
222
- }));
223
- if (pos === 'end' && endIcon) return jsx("span", Object.assign({
224
- className: 'button-icon button-icon-end'
225
- }, {
226
- children: endIcon
227
- }));
228
- return null;
229
- }
230
- if (typeof loading === 'object') {
231
- const delay = loading.delay || 0;
232
- setTimeout(() => setHasLoading(false), delay);
233
- }
234
- if (pos === 'start') return jsx("span", Object.assign({
235
- className: 'button-icon button-icon-loading'
236
- }, {
237
- children: jsx(LoadingOutlined, {})
238
- }));
239
- return null;
240
- };
241
- //按钮
242
- const renderButton = () => {
243
- if (isLinkBtn) {
244
- return jsxs("a", Object.assign({}, restProps, {
245
- href: href,
246
- target: target,
247
- className: makeCls()
248
- }, {
249
- children: [renderBtnIcon('start'), children && jsx("span", Object.assign({
250
- className: 'button-label'
251
- }, {
252
- children: children
253
- })), renderBtnIcon('end')]
254
- }));
255
- }
256
- return jsxs("button", Object.assign({
257
- disabled: disabled,
258
- type: "button",
259
- className: makeCls()
260
- }, restProps, {
261
- children: [renderBtnIcon('start'), children && jsx("span", Object.assign({
262
- className: 'button-label'
263
- }, {
264
- children: children
265
- })), renderBtnIcon('end')]
266
- }));
267
- };
268
- useEffect(() => {
269
- setHasLoading(!!loading);
270
- }, [loading]);
271
- return !!toolTipTitle ? jsx(Tooltip, Object.assign({
272
- arrow: false,
273
- placement: 'bottomLeft'
274
- }, TooltipProps, {
275
- disabled: disabled,
276
- title: toolTipTitle
277
- }, {
278
- children: disabled ? jsx("span", Object.assign({
279
- className: "".concat($prefixCls, "-button--disabled")
280
- }, {
281
- children: renderButton()
282
- })) : renderButton()
283
- })) : renderButton();
284
- };
285
- //icon button
286
- const IconButton = props => {
287
- const {
288
- variant = 'contained',
289
- size = 'large',
290
- toolTipTitle = '',
291
- children,
292
- className,
293
- disabled = false,
294
- loading = false,
295
- TooltipProps,
296
- danger = false,
297
- href,
298
- target
299
- } = props,
300
- restProps = __rest(props, ["variant", "size", "toolTipTitle", "children", "className", "disabled", "loading", "TooltipProps", "danger", "href", "target"]);
301
- const [hasLoading, setHasLoading] = useState(false);
302
- const isLinkBtn = ('href' in props);
303
- //cls
304
- const makeCls = () => {
305
- return clsx("".concat($prefixCls, "-button ").concat($prefixCls, "-icon-button"), className, "".concat($prefixCls, "-icon-button-").concat(variant), "".concat($prefixCls, "-icon-button-").concat(size), hasLoading && "".concat($prefixCls, "-icon-button-loading"), danger && !disabled && "".concat($prefixCls, "-icon-button-dangerous"), isLinkBtn && "".concat($prefixCls, "-button-link"), isLinkBtn && disabled && "".concat($prefixCls, "-button-link-disabled"));
306
- };
307
- //渲染图标
308
- const renderIcon = () => {
309
- if (!hasLoading) return children;
310
- if (typeof loading === 'object') {
311
- const delay = loading.delay || 0;
312
- setTimeout(() => setHasLoading(false), delay);
313
- }
314
- return jsx("span", Object.assign({
315
- className: 'button-loading-icon'
316
- }, {
317
- children: jsx(LoadingOutlined, {})
318
- }));
319
- };
320
- //icon button
321
- const renderIconButton = () => {
322
- if (isLinkBtn) {
323
- return jsx("a", Object.assign({}, restProps, {
324
- href: href,
325
- target: target,
326
- className: makeCls()
327
- }, {
328
- children: renderIcon()
329
- }));
330
- }
331
- return jsx("button", Object.assign({}, restProps, {
332
- disabled: disabled,
333
- type: "button",
334
- className: makeCls()
335
- }, {
336
- children: renderIcon()
337
- }));
338
- };
339
- useEffect(() => {
340
- setHasLoading(!!loading);
341
- }, [loading]);
342
- return !!toolTipTitle ? jsx(Tooltip, Object.assign({
343
- arrow: false,
344
- placement: 'bottomLeft'
345
- }, TooltipProps, {
346
- disabled: disabled,
347
- title: toolTipTitle
348
- }, {
349
- children: disabled ? jsx("span", Object.assign({
350
- className: "".concat($prefixCls, "-button--disabled")
351
- }, {
352
- children: renderIconButton()
353
- })) : renderIconButton()
354
- }), +hasLoading) : renderIconButton();
355
- };
356
- const Button = InternalButton;
357
- Button.IconButton = IconButton;
358
- Button.SplitButton = SplitButton;
359
-
360
- export { Button, Button as default };
21
+ import '../AutoTips/index.js';
22
+ import '@para-ui/icons/CheckCircleF';
23
+ import '@para-ui/icons/WarningCircle';
24
+ import '@para-ui/icons/CloseCircleF';
25
+ import '@para-ui/icons/WarningCircleF';
@@ -1,6 +1,6 @@
1
1
  import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { Button } from '../Button/index.js';
3
+ import { B as Button } from '../_verture/index-cd9ede02.js';
4
4
  import clsx from 'clsx';
5
5
  import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
6
6
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
@@ -19,6 +19,10 @@ import '@paraview/lib';
19
19
  import '../_verture/useFormatMessage-1fc7c957.js';
20
20
  import '../_verture/index-ca413216.js';
21
21
  import '../AutoTips/index.js';
22
+ import '@para-ui/icons/CheckCircleF';
23
+ import '@para-ui/icons/WarningCircle';
24
+ import '@para-ui/icons/CloseCircleF';
25
+ import '@para-ui/icons/WarningCircleF';
22
26
 
23
27
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/26 下午2:39\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-button-group {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v4-button-group .button-group-item {\n display: flex;\n align-items: center;\n}\n.paraui-v4-button-group.layout-vertical {\n flex-direction: column;\n}\n.paraui-v4-button-group.layout-vertical .button-group-item {\n flex-direction: column;\n}\n.paraui-v4-button-group.layout-vertical.paraui-v4-button-group-icon .button-group-item:not(:last-child) .paraui-v4-icon-button {\n border-bottom: 1px solid rgb(212, 218, 227);\n border-right: 0;\n}\n.paraui-v4-button-group.layout-vertical.paraui-v4-button-group-icon .button-group-item:first-child .paraui-v4-icon-button {\n border-radius: 4px 4px 0 0;\n}\n.paraui-v4-button-group.layout-vertical.paraui-v4-button-group-icon .button-group-item:last-child .paraui-v4-icon-button {\n border-radius: 0 0 4px 4px;\n}\n.paraui-v4-button-group-icon {\n border: 1px solid rgb(212, 218, 227);\n border-radius: 4px;\n}\n.paraui-v4-button-group-icon .paraui-v4-icon-button {\n border: none;\n border-radius: 0;\n}\n.paraui-v4-button-group-icon .button-group-item:not(:last-child) .paraui-v4-icon-button {\n border-right: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-button-group-icon .button-group-item:first-child .paraui-v4-icon-button {\n border-radius: 4px 0 0 4px;\n}\n.paraui-v4-button-group-icon .button-group-item:last-child .paraui-v4-icon-button {\n border-radius: 0 4px 4px 0;\n}\n.paraui-v4-button-group .text-icon {\n display: inline-block;\n width: 16px;\n height: 16px;\n margin-right: 4px;\n}\n.paraui-v4-button-group .btn-padding {\n width: 16px;\n height: 16px;\n}\n.paraui-v4-button-group .split-line {\n width: 1px;\n height: 12px;\n background: rgb(212, 218, 227);\n}";
24
28
  styleInject(css_248z);