@para-ui/core 4.0.0-rc → 4.0.0-rc.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/AutoBox/index.d.ts +1 -1
- package/AutoBox/index.js +12 -12
- package/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/AutoTips/index.d.ts +2 -2
- package/AutoTips/index.js +15 -21
- package/Badge/index.d.ts +23 -0
- package/Badge/index.js +54 -0
- package/Breadcrumbs/index.js +8 -8
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +8 -38
- package/Carousel/index.d.ts +6 -6
- package/Carousel/index.js +5 -5
- package/Cascader/Cascader.d.ts +10 -10
- package/Cascader/OptionList/Column.d.ts +3 -3
- package/Cascader/OptionList/index.d.ts +2 -2
- package/Cascader/index.d.ts +1 -1
- package/Cascader/index.js +4 -2
- package/Cascader/lang/en_US.d.ts +5 -0
- package/Cascader/lang/index.d.ts +11 -0
- package/Cascader/lang/zh_CN.d.ts +5 -0
- package/Cascader/utils/treeUtil.d.ts +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/Checkbox/index.js +5 -5
- package/CheckboxGroup/index.d.ts +2 -2
- package/CheckboxGroup/index.js +4 -4
- package/Collapse/index.js +5 -5
- package/CollapseBox/index.js +12 -20
- package/CollapseLayout/index.js +21 -21
- package/ColorPicker/index.js +2 -2
- package/ComboSelect/index.js +43 -52
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.d.ts +3 -3
- package/Container/index.js +56 -56
- package/CopyText/index.d.ts +2 -2
- package/CopyText/index.js +3 -3
- package/DatePicker/generatePicker/index.d.ts +22 -22
- package/DatePicker/index.js +10 -9
- package/DatePicker/util.d.ts +1 -1
- package/Descriptions/index.d.ts +38 -0
- package/Descriptions/index.js +23 -0
- package/Desktop/index.d.ts +1 -1
- package/Desktop/index.js +18 -13
- package/DragVerify/index.d.ts +1 -1
- package/DragVerify/index.js +13 -13
- package/Drawer/index.js +40 -38
- package/Drawer/interface.d.ts +4 -6
- package/Dropdown/index.d.ts +1 -1
- package/DynamicMultiBox/formItem.d.ts +1 -1
- package/DynamicMultiBox/index.d.ts +1 -1
- package/DynamicMultiBox/index.js +38 -35
- package/DynamicMultiBox/interface.d.ts +8 -8
- package/DynamicMultiBox/rowForm.d.ts +3 -1
- package/Empty/index.d.ts +1 -1
- package/Empty/index.js +3 -3
- package/Form/index.d.ts +12 -13
- package/Form/index.js +10 -8
- package/FormItem/compoments/defaultCompoments/index.d.ts +4 -4
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +1 -1
- package/FormItem/compoments/formFile/index.d.ts +2 -2
- package/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/FormItem/compoments/formSelect/index.d.ts +7 -7
- package/FormItem/errorTips.d.ts +3 -3
- package/FormItem/index.d.ts +5 -5
- package/FormItem/index.js +3 -2
- package/FormItem/lang/en_US.d.ts +10 -0
- package/FormItem/lang/index.d.ts +21 -0
- package/FormItem/lang/zh_CN.d.ts +10 -0
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/dialog.d.ts +26 -26
- package/FunctionModal/index.d.ts +6 -6
- package/FunctionModal/index.js +9 -10
- package/FunctionModal/modalContext.d.ts +3 -3
- package/GlobalContext/componentsProps.d.ts +7 -7
- package/GlobalContext/confirmLocale.d.ts +1 -2
- package/GlobalContext/index.d.ts +2 -2
- package/GlobalContext/index.js +3 -2
- package/GlobalContext/useFormatMessage.d.ts +1 -1
- package/Help/index.js +2 -2
- package/HelperText/index.js +1 -1
- package/InputLang/index.d.ts +2 -2
- package/InputLang/index.js +8 -8
- package/InputNumber/index.d.ts +4 -2
- package/InputNumber/index.js +27 -15
- package/Label/index.js +2 -2
- package/Loading/index.js +1 -1
- package/Menu/index.js +17 -17
- package/Menu/interface.d.ts +1 -1
- package/Message/index.js +13 -13
- package/Modal/Confirm/index.d.ts +3 -3
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +20 -17
- package/Modal/lang/index.d.ts +8 -0
- package/MultiBox/index.d.ts +2 -2
- package/MultiBox/index.js +4 -4
- package/Notification/index.js +2 -2
- package/OperateBtn/index.d.ts +2 -2
- package/OperateBtn/index.js +49 -49
- package/PageHeader/index.js +45 -34
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +1 -1
- package/Pagination/index.js +19 -19
- package/PasswordRules/index.js +8 -8
- package/PopConfirm/index.js +8 -7
- package/Progress/Line.d.ts +10 -10
- package/Progress/Steps.d.ts +2 -2
- package/Progress/index.d.ts +12 -12
- package/Progress/index.js +43 -42
- package/Progress/utils.d.ts +4 -4
- package/Querying/index.d.ts +1 -1
- package/Querying/index.js +3 -3
- package/README.md +7 -0
- package/Radio/index.d.ts +1 -1
- package/Radio/index.js +5 -5
- package/RadioGroup/index.d.ts +2 -2
- package/RadioGroup/index.js +4 -4
- package/Search/index.js +1 -1
- package/Select/index.d.ts +3 -3
- package/Select/index.js +43 -43
- package/SelectInput/index.js +2 -2
- package/Selector/index.js +26 -34
- package/Selector/interface.d.ts +6 -6
- package/SelectorPicker/index.d.ts +4 -4
- package/SelectorPicker/index.js +10 -10
- package/SingleBox/index.d.ts +2 -2
- package/SingleBox/index.js +4 -4
- package/Slider/index.js +1 -1
- package/Slider/interface.d.ts +1 -1
- package/Status/index.d.ts +4 -4
- package/Status/index.js +6 -7
- package/Stepper/index.d.ts +5 -5
- package/Stepper/index.js +23 -23
- package/Styles/theme.scss +1 -0
- package/Switch/index.d.ts +7 -7
- package/Switch/index.js +38 -21
- package/Switch/lang/en_US.d.ts +4 -0
- package/Switch/lang/index.d.ts +9 -0
- package/Switch/lang/zh_CN.d.ts +4 -0
- package/Table/index.js +35 -35
- package/Table/interface.d.ts +4 -4
- package/Table/tableBodyElement/index.d.ts +1 -1
- package/Table/tableBodyInterface.d.ts +2 -2
- package/Table/tableContainer/index.d.ts +1 -1
- package/Table/tableElement/index.d.ts +1 -1
- package/Table/tableHeadElement/index.d.ts +1 -1
- package/Table/tableHeadInterface.d.ts +1 -1
- package/Table/tablePaginationInterface.d.ts +6 -6
- package/Table/tdElement/index.d.ts +1 -1
- package/Table/thElement/index.d.ts +2 -2
- package/Table/trElement/index.d.ts +1 -1
- package/Table/util.d.ts +1 -1
- package/Tabs/index.d.ts +1 -1
- package/Tabs/index.js +27 -19
- package/Tag/TagGroup.d.ts +5 -5
- package/Tag/index.d.ts +7 -7
- package/Tag/index.js +25 -25
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +45 -27
- package/TextEditor/lang/en_US.d.ts +4 -0
- package/TextEditor/lang/index.d.ts +9 -0
- package/TextEditor/lang/zh_CN.d.ts +4 -0
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +19 -16
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +2 -2
- package/Timeline/TimelineItem.d.ts +1 -1
- package/Timeline/index.d.ts +5 -5
- package/Timeline/index.js +14 -14
- package/Title/index.d.ts +4 -4
- package/Title/index.js +3 -3
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.d.ts +5 -1
- package/ToggleButton/index.js +18 -11
- package/Transfer/box.d.ts +6 -6
- package/Transfer/index.js +22 -25
- package/Tree/OperateBar/index.d.ts +4 -4
- package/Tree/Tree.d.ts +2 -2
- package/Tree/index.js +2 -2
- package/Tree/interface.d.ts +4 -4
- package/Tree/utils/tools.d.ts +1 -1
- package/Upload/Dragger/index.d.ts +2 -2
- package/Upload/ErroTip/index.d.ts +1 -1
- package/Upload/index.d.ts +2 -2
- package/Upload/index.js +10 -11
- package/Upload/interface.d.ts +1 -1
- package/_verture/{index-8469865e.js → index-024bbc9b.js} +3 -3
- package/_verture/{index-19947788.js → index-05f7bf11.js} +3 -1
- package/_verture/{index-e1b800aa.js → index-50f56891.js} +49 -25
- package/_verture/{index-1c8d3e94.js → index-649b450f.js} +102 -48
- package/_verture/{index-47297a40.js → index-692e29c1.js} +53 -46
- package/_verture/{modalContext-670eab09.js → modalContext-11c51a45.js} +25 -25
- package/index.d.ts +4 -0
- package/index.js +14 -11
- package/locale/en-US.d.ts +19 -0
- package/locale/index.d.ts +38 -0
- package/locale/index.js +40 -2
- package/locale/zh-CN.d.ts +19 -0
- package/package.json +4 -2
- package/umd/AutoBox.js +1 -1
- package/umd/AutoTips.js +1 -1
- package/umd/Badge.js +1 -0
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Button.js +2 -2
- package/umd/ButtonGroup.js +2 -2
- package/umd/Cascader.js +4 -4
- package/umd/Checkbox.js +2 -2
- package/umd/CheckboxGroup.js +2 -2
- package/umd/Collapse.js +5 -5
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +4 -4
- package/umd/CopyText.js +2 -2
- package/umd/DatePicker.js +2 -2
- package/umd/Descriptions.js +1 -0
- package/umd/Desktop.js +2 -2
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +2 -2
- package/umd/DynamicMultiBox.js +4 -4
- package/umd/Empty.js +1 -1
- package/umd/Form.js +4 -4
- package/umd/FormItem.js +4 -4
- package/umd/FunctionModal.js +4 -4
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +2 -2
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +2 -2
- package/umd/InputNumber.js +4 -4
- package/umd/Label.js +2 -2
- package/umd/Loading.js +1 -1
- package/umd/Menu.js +3 -3
- package/umd/Message.js +2 -2
- package/umd/Modal.js +4 -4
- package/umd/MultiBox.js +7 -7
- package/umd/Notification.js +2 -2
- package/umd/OperateBtn.js +4 -4
- package/umd/PageHeader.js +4 -4
- package/umd/Pagination.js +2 -2
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +2 -2
- package/umd/Progress.js +3 -3
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +2 -2
- package/umd/RadioGroup.js +2 -2
- package/umd/Search.js +7 -7
- package/umd/Select.js +2 -2
- package/umd/SelectInput.js +2 -2
- package/umd/Selector.js +2 -2
- package/umd/SelectorPicker.js +2 -2
- package/umd/SingleBox.js +2 -2
- package/umd/Slider.js +1 -1
- package/umd/Status.js +2 -2
- package/umd/Stepper.js +1 -1
- package/umd/Switch.js +5 -5
- package/umd/Table.js +6 -6
- package/umd/Tabs.js +6 -6
- package/umd/Tag.js +1 -1
- package/umd/TextEditor.js +3 -3
- package/umd/TextField.js +7 -7
- package/umd/TimePicker.js +2 -2
- package/umd/Title.js +7 -7
- package/umd/ToggleButton.js +4 -4
- package/umd/Transfer.js +3 -3
- package/umd/Tree.js +2 -2
- package/umd/Upload.js +2 -2
- package/umd/locale.js +1 -1
package/TextEditor/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { i18nChangeLanguage } from '@wangeditor/editor';
|
|
|
7
7
|
import HelperText from '../HelperText/index.js';
|
|
8
8
|
import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
|
|
9
9
|
import { UUID } from '@paraview/lib';
|
|
10
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
10
11
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
11
12
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
12
13
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -17,38 +18,52 @@ import 'rc-tooltip/lib/placements';
|
|
|
17
18
|
import 'clsx';
|
|
18
19
|
import '@para-ui/icons/Forbid';
|
|
19
20
|
import '@para-ui/icons/Help';
|
|
21
|
+
import '@para-ui/core/GlobalContext';
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* @author xh
|
|
23
25
|
* @date 2022/09/06 18:00
|
|
24
26
|
* @description 存放富文本编辑器的一些默认配置
|
|
25
27
|
*/
|
|
26
|
-
var TOOL_BAR_CONFIG = [
|
|
27
|
-
key:
|
|
28
|
-
title:
|
|
28
|
+
var TOOL_BAR_CONFIG = ['headerSelect', 'blockquote', '|', 'bold', 'underline', 'italic', {
|
|
29
|
+
key: 'group-more-style',
|
|
30
|
+
title: '更多',
|
|
29
31
|
iconSvg: '<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>',
|
|
30
|
-
menuKeys: [
|
|
31
|
-
},
|
|
32
|
-
key:
|
|
33
|
-
title:
|
|
32
|
+
menuKeys: ['through', 'code', 'sup', 'sub', 'clearStyle']
|
|
33
|
+
}, 'color', 'bgColor', '|', 'fontSize', 'fontFamily', 'lineHeight', '|', 'bulletedList', 'numberedList', 'todo', {
|
|
34
|
+
key: 'group-justify',
|
|
35
|
+
title: '对齐',
|
|
34
36
|
iconSvg: '<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',
|
|
35
|
-
menuKeys: [
|
|
37
|
+
menuKeys: ['justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify']
|
|
36
38
|
}, {
|
|
37
|
-
key:
|
|
38
|
-
title:
|
|
39
|
+
key: 'group-indent',
|
|
40
|
+
title: '缩进',
|
|
39
41
|
iconSvg: '<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',
|
|
40
|
-
menuKeys: [
|
|
41
|
-
},
|
|
42
|
-
key:
|
|
43
|
-
title:
|
|
42
|
+
menuKeys: ['indent', 'delIndent']
|
|
43
|
+
}, '|', 'emotion', 'insertLink', {
|
|
44
|
+
key: 'group-image',
|
|
45
|
+
title: '图片',
|
|
44
46
|
iconSvg: '<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',
|
|
45
|
-
menuKeys: [
|
|
47
|
+
menuKeys: ['insertImage', 'uploadImage']
|
|
46
48
|
}, {
|
|
47
|
-
key:
|
|
48
|
-
title:
|
|
49
|
+
key: 'group-video',
|
|
50
|
+
title: '视频',
|
|
49
51
|
iconSvg: '<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',
|
|
50
|
-
menuKeys: [
|
|
51
|
-
},
|
|
52
|
+
menuKeys: ['insertVideo', 'uploadVideo']
|
|
53
|
+
}, 'insertTable', 'codeBlock', 'divider', '|', 'undo', 'redo', '|', 'fullScreen'];
|
|
54
|
+
|
|
55
|
+
var en = {
|
|
56
|
+
pleaseEnter: 'Please Enter'
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var zh = {
|
|
60
|
+
pleaseEnter: '请输入内容'
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var localeJson = {
|
|
64
|
+
zh: zh,
|
|
65
|
+
en: en
|
|
66
|
+
};
|
|
52
67
|
|
|
53
68
|
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-text-editor .w-e-max-length-info {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-text-editor .w-e-bar-item > button:hover {\n background: rgb(247, 248, 250);\n border-radius: 2px;\n}\n.paraui-v4-text-editor .w-e-bar-item-menus-container .w-e-bar-item {\n padding-left: 0;\n padding-right: 0;\n display: flex;\n}\n.paraui-v4-text-editor .w-e-bar-item-menus-container .w-e-bar-item > button {\n flex: 1;\n display: flex;\n justify-content: flex-start;\n}\n.paraui-v4-text-editor .w-e-bar-item-menus-container .w-e-bar-item > button:hover {\n background: rgb(247, 248, 250);\n border-radius: 2px;\n}\n.paraui-v4-text-editor .w-e-full-screen-container {\n z-index: 1000;\n}\n.paraui-v4-text-editor .text-editor-content {\n border: 1px solid rgb(212, 218, 227);\n border-radius: 4px;\n padding: 1px 0;\n background-color: #fff;\n}\n.paraui-v4-text-editor .text-editor-content > div:nth-child(1) {\n border-bottom: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-text-editor .text-editor-content div[contenteditable=false] {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-text-editor .text-editor-content div[contenteditable=false]:hover {\n border-color: rgb(212, 218, 227);\n cursor: not-allowed;\n}\n.paraui-v4-text-editor .preview-mode > div:nth-child(1) {\n border-bottom: none;\n}";
|
|
54
69
|
styleInject(css_248z$1);
|
|
@@ -57,6 +72,7 @@ var css_248z = ":root,\n:host {\n --w-e-textarea-bg-color: #fff;\n --w-e-texta
|
|
|
57
72
|
styleInject(css_248z);
|
|
58
73
|
|
|
59
74
|
var TextEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
75
|
+
var intl = useFormatMessage('TextEditor', localeJson);
|
|
60
76
|
var style = props.style,
|
|
61
77
|
_props$toolbarStyle = props.toolbarStyle,
|
|
62
78
|
toolbarStyle = _props$toolbarStyle === void 0 ? {} : _props$toolbarStyle,
|
|
@@ -75,7 +91,9 @@ var TextEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
75
91
|
label = props.label,
|
|
76
92
|
labelTooltip = props.labelTooltip,
|
|
77
93
|
_props$placeholder = props.placeholder,
|
|
78
|
-
placeholder = _props$placeholder === void 0 ?
|
|
94
|
+
placeholder = _props$placeholder === void 0 ? intl({
|
|
95
|
+
id: 'pleaseEnter'
|
|
96
|
+
}) : _props$placeholder,
|
|
79
97
|
onChange = props.onChange,
|
|
80
98
|
onFocus = props.onFocus,
|
|
81
99
|
onBlur = props.onBlur,
|
|
@@ -230,12 +248,12 @@ var TextEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
230
248
|
};
|
|
231
249
|
});
|
|
232
250
|
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
251
|
+
* 处理class
|
|
252
|
+
* @return {string}
|
|
253
|
+
*/
|
|
236
254
|
var handClass = function handClass() {
|
|
237
|
-
var str = $prefixCls
|
|
238
|
-
if (className) str +=
|
|
255
|
+
var str = "".concat($prefixCls, "-text-editor");
|
|
256
|
+
if (className) str += " ".concat(className);
|
|
239
257
|
return str;
|
|
240
258
|
};
|
|
241
259
|
/** 标题 */
|
|
@@ -243,7 +261,7 @@ var TextEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
243
261
|
var handLabelClass = function handLabelClass() {
|
|
244
262
|
var str = 'text-editor-label';
|
|
245
263
|
if (labelTooltip && labelTooltip.className) {
|
|
246
|
-
str +=
|
|
264
|
+
str += " ".concat(labelTooltip.className);
|
|
247
265
|
}
|
|
248
266
|
return str;
|
|
249
267
|
};
|
|
@@ -260,7 +278,7 @@ var TextEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
260
278
|
style: style
|
|
261
279
|
}, {
|
|
262
280
|
children: [labelMemo, jsxs("div", Object.assign({
|
|
263
|
-
className: "text-editor-content ".concat(isPreview ?
|
|
281
|
+
className: "text-editor-content ".concat(isPreview ? 'preview-mode' : '')
|
|
264
282
|
}, {
|
|
265
283
|
children: [jsx(Toolbar, {
|
|
266
284
|
editor: editor,
|
package/TextField/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
7
|
import { LabelTooltipProps } from '../Label';
|
|
8
8
|
import { TooltipProps } from '../Tooltip';
|
|
9
|
-
import { HelperTextDetailProps } from
|
|
9
|
+
import { HelperTextDetailProps } from '../HelperText';
|
|
10
10
|
import './index.scss';
|
|
11
11
|
export interface TextFieldProps extends HelperTextDetailProps {
|
|
12
12
|
/** 样式class */
|
package/TextField/index.js
CHANGED
|
@@ -98,7 +98,7 @@ var TextField = function TextField(props) {
|
|
|
98
98
|
onSelect = _a.onSelect,
|
|
99
99
|
onClear = _a.onClear,
|
|
100
100
|
otherProps = __rest(_a, ["className", "style", "size", "labelMode", "placeholder", "label", "labelTooltip", "disabled", "disabledTooltip", "multiline", "required", "labelSign", "rows", "error", "hideErrorDom", "helperText", "addonBefore", "addonAfter", "defaultValue", "value", "type", "onClickIcon", "rightIcon", "showRightIcon", "allowClear", "limitLength", "fetchSuggestions", "selectPopoverClass", "renderSelectItem", "showSelectName", "resize", "searchEmpty", "onBlur", "onFocus", "onChange", "onKeydown", "onKeyUp", "onEnter", "onClickAddonBefore", "onClickAddonAfter", "onSelect", "onClear"]);
|
|
101
|
-
var _useState = useState(
|
|
101
|
+
var _useState = useState("text-field-select-content-".concat(UUID())),
|
|
102
102
|
_useState2 = _slicedToArray(_useState, 1),
|
|
103
103
|
classSearchOne = _useState2[0]; // 唯一class
|
|
104
104
|
var _useState3 = useState(true),
|
|
@@ -158,12 +158,12 @@ var TextField = function TextField(props) {
|
|
|
158
158
|
}, [isFocus, fetchSuggestions]);
|
|
159
159
|
useEffect(function () {
|
|
160
160
|
if (open) {
|
|
161
|
-
window.addEventListener(
|
|
161
|
+
window.addEventListener('keydown', keydownCom);
|
|
162
162
|
} else {
|
|
163
|
-
window.removeEventListener(
|
|
163
|
+
window.removeEventListener('keydown', keydownCom);
|
|
164
164
|
}
|
|
165
165
|
return function () {
|
|
166
|
-
window.removeEventListener(
|
|
166
|
+
window.removeEventListener('keydown', keydownCom);
|
|
167
167
|
};
|
|
168
168
|
}, [open]);
|
|
169
169
|
useEffect(function () {
|
|
@@ -231,7 +231,7 @@ var TextField = function TextField(props) {
|
|
|
231
231
|
brotherDom = selectDom.querySelector('.text-field-select-content-item');
|
|
232
232
|
}
|
|
233
233
|
if (brotherDom) {
|
|
234
|
-
brotherDom.classList.add(
|
|
234
|
+
brotherDom.classList.add('text-field-select-content-item-keydown');
|
|
235
235
|
domClientTop(brotherDom, selectDom);
|
|
236
236
|
}
|
|
237
237
|
};
|
|
@@ -255,7 +255,7 @@ var TextField = function TextField(props) {
|
|
|
255
255
|
* @param e 键盘信息
|
|
256
256
|
*/
|
|
257
257
|
var keydownCom = function keydownCom(e) {
|
|
258
|
-
var selectDom = document.querySelector(
|
|
258
|
+
var selectDom = document.querySelector(".".concat(classSearchOne));
|
|
259
259
|
var currentDom = null;
|
|
260
260
|
var keydownDom = selectDom.querySelector('.text-field-select-content-item-keydown');
|
|
261
261
|
// 回车
|
|
@@ -269,7 +269,7 @@ var TextField = function TextField(props) {
|
|
|
269
269
|
}
|
|
270
270
|
if (keydownDom) {
|
|
271
271
|
currentDom = keydownDom;
|
|
272
|
-
keydownDom.classList.remove(
|
|
272
|
+
keydownDom.classList.remove('text-field-select-content-item-keydown');
|
|
273
273
|
}
|
|
274
274
|
// 下
|
|
275
275
|
if (e.keyCode === 40) {
|
|
@@ -373,7 +373,7 @@ var TextField = function TextField(props) {
|
|
|
373
373
|
var handleClassPopover = function handleClassPopover() {
|
|
374
374
|
var str = "".concat($prefixCls, "-text-field-select ").concat($prefixCls, "-scrollbar-small");
|
|
375
375
|
if (size) str += " ".concat($prefixCls, "-text-field-select-").concat(size);
|
|
376
|
-
if (selectPopoverClass) str +=
|
|
376
|
+
if (selectPopoverClass) str += " ".concat(selectPopoverClass);
|
|
377
377
|
if (selectData.length > 0) str += " ".concat($prefixCls, "-text-field-select-data");
|
|
378
378
|
return str;
|
|
379
379
|
};
|
|
@@ -389,7 +389,7 @@ var TextField = function TextField(props) {
|
|
|
389
389
|
children: IsNaN(limitLength) && jsx("span", Object.assign({
|
|
390
390
|
className: "length-limit"
|
|
391
391
|
}, {
|
|
392
|
-
children: (valueCom ? valueCom.toString().length : 0
|
|
392
|
+
children: "".concat(valueCom ? valueCom.toString().length : 0, "/").concat(limitLength)
|
|
393
393
|
}))
|
|
394
394
|
});
|
|
395
395
|
}, [limitLength, valueCom]);
|
|
@@ -452,7 +452,8 @@ var TextField = function TextField(props) {
|
|
|
452
452
|
};
|
|
453
453
|
// 清空内容
|
|
454
454
|
var clearRender = function clearRender() {
|
|
455
|
-
|
|
455
|
+
var valCom = handValue();
|
|
456
|
+
if ((valCom || valCom === 0) && !disabled && allowClear) {
|
|
456
457
|
return jsx("span", Object.assign({
|
|
457
458
|
className: "clean-up-icon",
|
|
458
459
|
onClick: clickClean
|
|
@@ -475,6 +476,7 @@ var TextField = function TextField(props) {
|
|
|
475
476
|
})]
|
|
476
477
|
});
|
|
477
478
|
};
|
|
479
|
+
var valCom = handValue();
|
|
478
480
|
var contentRender = function contentRender() {
|
|
479
481
|
return jsxs("div", Object.assign({
|
|
480
482
|
className: "text-field-content-within",
|
|
@@ -483,7 +485,7 @@ var TextField = function TextField(props) {
|
|
|
483
485
|
children: [jsxs("div", Object.assign({
|
|
484
486
|
className: "text-field-content-within-input"
|
|
485
487
|
}, {
|
|
486
|
-
children: [renderInputDom(), !
|
|
488
|
+
children: [renderInputDom(), !valCom && valCom !== 0 && jsx("span", Object.assign({
|
|
487
489
|
className: "text-field-label-placeholder" /*onClick={clickPlaceholder}*/
|
|
488
490
|
}, {
|
|
489
491
|
children: handPlaceholderCon()
|
|
@@ -498,7 +500,7 @@ var TextField = function TextField(props) {
|
|
|
498
500
|
var handSelectContentClass = function handSelectContentClass() {
|
|
499
501
|
var str = 'text-field-select-content';
|
|
500
502
|
if (selectLoading) str += ' text-field-select-content-loading';
|
|
501
|
-
if (classSearchOne) str +=
|
|
503
|
+
if (classSearchOne) str += " ".concat(classSearchOne);
|
|
502
504
|
return str;
|
|
503
505
|
};
|
|
504
506
|
var handText = function handText(item) {
|
|
@@ -510,7 +512,7 @@ var TextField = function TextField(props) {
|
|
|
510
512
|
return jsxs("div", Object.assign({
|
|
511
513
|
className: handSelectContentClass(),
|
|
512
514
|
style: {
|
|
513
|
-
width: (selectPosDom && selectPosDom.current ? selectPosDom.current.offsetWidth : 0
|
|
515
|
+
width: "".concat(selectPosDom && selectPosDom.current ? selectPosDom.current.offsetWidth : 0, "px")
|
|
514
516
|
}
|
|
515
517
|
}, {
|
|
516
518
|
children: [selectData && selectData.map(function (item, index) {
|
|
@@ -547,7 +549,7 @@ var TextField = function TextField(props) {
|
|
|
547
549
|
var handLabelClass = function handLabelClass() {
|
|
548
550
|
var str = 'text-field-label';
|
|
549
551
|
if (labelTooltip && labelTooltip.className) {
|
|
550
|
-
str +=
|
|
552
|
+
str += " ".concat(labelTooltip.className);
|
|
551
553
|
}
|
|
552
554
|
return str;
|
|
553
555
|
};
|
|
@@ -564,7 +566,7 @@ var TextField = function TextField(props) {
|
|
|
564
566
|
// 处理class
|
|
565
567
|
var handClass = function handClass() {
|
|
566
568
|
var str = "".concat($prefixCls, "-text-field");
|
|
567
|
-
if (className) str +=
|
|
569
|
+
if (className) str += " ".concat(className);
|
|
568
570
|
if (size && !multiline) str += " ".concat($prefixCls, "-text-field-").concat(size);
|
|
569
571
|
if (error) str += " ".concat($prefixCls, "-text-field-error");
|
|
570
572
|
if (isFocus) str += " ".concat($prefixCls, "-text-field-focus");
|
|
@@ -573,7 +575,8 @@ var TextField = function TextField(props) {
|
|
|
573
575
|
if (IsNaN(props.limitLength)) str += " ".concat($prefixCls, "-text-field-limit-length");
|
|
574
576
|
if (IsNaN(props.limitLength) && valueCom && valueCom.toString().length > Number(props.limitLength)) str += " ".concat($prefixCls, "-text-field-limit");
|
|
575
577
|
if (resize) str += " ".concat($prefixCls, "-text-field-resize");
|
|
576
|
-
|
|
578
|
+
var valCom = handValue();
|
|
579
|
+
if (valCom || valCom === 0) str += " ".concat($prefixCls, "-text-field-value");
|
|
577
580
|
if (allowClear) str += " ".concat($prefixCls, "-text-field-allow-clear");
|
|
578
581
|
return str;
|
|
579
582
|
};
|
package/TimePicker/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Dayjs } from 'dayjs';
|
|
3
3
|
import { PickerTimeProps, RangePickerTimeProps } from '../DatePicker/generatePicker';
|
|
4
|
-
import { TooltipProps } from
|
|
4
|
+
import { TooltipProps } from '../Tooltip';
|
|
5
5
|
export interface TimePickerLocale {
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
rangePlaceholder?: [string, string];
|
package/TimePicker/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import '../_verture/slicedToArray-a8206399.js';
|
|
|
10
10
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
11
11
|
import 'clsx';
|
|
12
12
|
import '@para-ui/icons/LoadingF';
|
|
13
|
-
import '@para-ui/icons/Forbid';
|
|
14
13
|
import '@para-ui/icons/Down';
|
|
15
14
|
import '../_verture/constant-0d9802f7.js';
|
|
16
15
|
import '../_verture/style-inject.es-300983ab.js';
|
|
@@ -24,6 +23,7 @@ import '@para-ui/core/GlobalContext';
|
|
|
24
23
|
import '../AutoTips/index.js';
|
|
25
24
|
import 'rc-tooltip';
|
|
26
25
|
import 'rc-tooltip/lib/placements';
|
|
26
|
+
import '@para-ui/icons/Forbid';
|
|
27
27
|
import '../Tag/index.js';
|
|
28
28
|
import '../_verture/defineProperty-1d116156.js';
|
|
29
29
|
import '@para-ui/icons/Close';
|
|
@@ -73,7 +73,7 @@ var TimePicker = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
73
73
|
var renderPicker = function renderPicker() {
|
|
74
74
|
var component = jsx(InternalTimePicker, Object.assign({}, restProps, {
|
|
75
75
|
disabled: disabled,
|
|
76
|
-
picker:
|
|
76
|
+
picker: "time",
|
|
77
77
|
dropdownClassName: popupClassName,
|
|
78
78
|
mode: undefined,
|
|
79
79
|
ref: ref,
|
package/Timeline/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @date 2022/6/9 下午7:21
|
|
4
4
|
* @description Timeline
|
|
5
5
|
*/
|
|
6
|
-
import React from
|
|
7
|
-
import { TimelineItemProps } from
|
|
8
|
-
import
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { TimelineItemProps } from './TimelineItem';
|
|
8
|
+
import './index.scss';
|
|
9
9
|
export interface TimelineProps {
|
|
10
10
|
/** cls */
|
|
11
11
|
className?: string;
|
|
@@ -18,8 +18,8 @@ export interface TimelineProps {
|
|
|
18
18
|
/** 节点排序 */
|
|
19
19
|
reverse?: boolean;
|
|
20
20
|
/** 改变时间轴和内容的相对位置 */
|
|
21
|
-
mode?:
|
|
22
|
-
align?:
|
|
21
|
+
mode?: 'left' | 'alternate' | 'right' | 'double';
|
|
22
|
+
align?: 'left' | 'alternate' | 'right' | 'double';
|
|
23
23
|
/** timeline item */
|
|
24
24
|
data?: TimelineItemProps[];
|
|
25
25
|
[name: string]: any;
|
package/Timeline/index.js
CHANGED
|
@@ -63,13 +63,13 @@ var Timeline = function Timeline(props) {
|
|
|
63
63
|
_props$reverse = props.reverse,
|
|
64
64
|
reverse = _props$reverse === void 0 ? false : _props$reverse,
|
|
65
65
|
_props$mode = props.mode,
|
|
66
|
-
mode = _props$mode === void 0 ?
|
|
66
|
+
mode = _props$mode === void 0 ? 'left' : _props$mode,
|
|
67
67
|
align = props.align,
|
|
68
68
|
data = props.data,
|
|
69
69
|
restProps = __rest(props, ["pending", "pendingDot", "children", "className", "reverse", "mode", "align", "data"]);
|
|
70
70
|
var prefixCls = "".concat($prefixCls, "-timeline");
|
|
71
71
|
var innerMode = align !== null && align !== void 0 ? align : mode; //时间轴和内容相对位置
|
|
72
|
-
var pendingNode = typeof pending ===
|
|
72
|
+
var pendingNode = typeof pending === 'boolean' ? null : pending; //是否有幽灵节点
|
|
73
73
|
//pending节点项
|
|
74
74
|
var pendingItem = pending ? jsx(TimelineItem, Object.assign({
|
|
75
75
|
pending: !!pending,
|
|
@@ -86,16 +86,16 @@ var Timeline = function Timeline(props) {
|
|
|
86
86
|
//position cls
|
|
87
87
|
var getPositionCls = function getPositionCls(ele, idx) {
|
|
88
88
|
var _a, _b, _c;
|
|
89
|
-
if (innerMode ===
|
|
90
|
-
if (((_a = ele === null || ele === void 0 ? void 0 : ele.props) === null || _a === void 0 ? void 0 : _a.position) ===
|
|
91
|
-
if (((_b = ele === null || ele === void 0 ? void 0 : ele.props) === null || _b === void 0 ? void 0 : _b.position) ===
|
|
89
|
+
if (innerMode === 'alternate') {
|
|
90
|
+
if (((_a = ele === null || ele === void 0 ? void 0 : ele.props) === null || _a === void 0 ? void 0 : _a.position) === 'right') return "".concat($rcPrefixCls, "-timeline-item-right");
|
|
91
|
+
if (((_b = ele === null || ele === void 0 ? void 0 : ele.props) === null || _b === void 0 ? void 0 : _b.position) === 'left') return "".concat($rcPrefixCls, "-timeline-item-left");
|
|
92
92
|
return idx % 2 === 0 ? "".concat($rcPrefixCls, "-timeline-item-left") : "".concat($rcPrefixCls, "-timeline-item-right");
|
|
93
93
|
}
|
|
94
|
-
if (innerMode ===
|
|
95
|
-
if (innerMode ===
|
|
96
|
-
if (innerMode ===
|
|
97
|
-
if (((_c = ele === null || ele === void 0 ? void 0 : ele.props) === null || _c === void 0 ? void 0 : _c.position) ===
|
|
98
|
-
return
|
|
94
|
+
if (innerMode === 'left') return "".concat($rcPrefixCls, "-timeline-item-left");
|
|
95
|
+
if (innerMode === 'right') return "".concat($rcPrefixCls, "-timeline-item-right");
|
|
96
|
+
if (innerMode === 'double') return "".concat($rcPrefixCls, "-timeline-item-double");
|
|
97
|
+
if (((_c = ele === null || ele === void 0 ? void 0 : ele.props) === null || _c === void 0 ? void 0 : _c.position) === 'right') return "".concat($rcPrefixCls, "-timeline-item-right");
|
|
98
|
+
return '';
|
|
99
99
|
};
|
|
100
100
|
//实际渲染项
|
|
101
101
|
var truthyItems = timeLineItems.filter(function (item) {
|
|
@@ -104,8 +104,8 @@ var Timeline = function Timeline(props) {
|
|
|
104
104
|
var itemsCount = React__default.Children.count(truthyItems);
|
|
105
105
|
var lastCls = "".concat($rcPrefixCls, "-timeline-item-last");
|
|
106
106
|
var items = React__default.Children.map(truthyItems, function (ele, idx) {
|
|
107
|
-
var pendingClass = idx === itemsCount - 2 ? lastCls :
|
|
108
|
-
var readyClass = idx === itemsCount - 1 ? lastCls :
|
|
107
|
+
var pendingClass = idx === itemsCount - 2 ? lastCls : '';
|
|
108
|
+
var readyClass = idx === itemsCount - 1 ? lastCls : '';
|
|
109
109
|
return /*#__PURE__*/React__default.cloneElement(ele, {
|
|
110
110
|
className: clsx([ele.props.className, !reverse && !!pending ? pendingClass : readyClass, getPositionCls(ele, idx)])
|
|
111
111
|
});
|
|
@@ -129,8 +129,8 @@ var Timeline = function Timeline(props) {
|
|
|
129
129
|
disabled = _item$disabled === void 0 ? false : _item$disabled,
|
|
130
130
|
className = item.className,
|
|
131
131
|
label = item.label;
|
|
132
|
-
var pendingClass = idx === itemsCount - 2 ? lastCls :
|
|
133
|
-
var readyClass = idx === itemsCount - 1 ? lastCls :
|
|
132
|
+
var pendingClass = idx === itemsCount - 2 ? lastCls : '';
|
|
133
|
+
var readyClass = idx === itemsCount - 1 ? lastCls : '';
|
|
134
134
|
return jsx(TimelineItem, Object.assign({
|
|
135
135
|
label: innerMode === 'double' && label,
|
|
136
136
|
dot: dotIcon,
|
package/Title/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @date 2022/8/11 2:54 PM
|
|
4
4
|
* @description 标题
|
|
5
5
|
*/
|
|
6
|
-
import React, { FC, ReactNode } from
|
|
7
|
-
import
|
|
6
|
+
import React, { FC, ReactNode } from 'react';
|
|
7
|
+
import './index.scss';
|
|
8
8
|
export interface TitleProps {
|
|
9
9
|
/** 标题 **/
|
|
10
10
|
title: ReactNode;
|
|
@@ -13,7 +13,7 @@ export interface TitleProps {
|
|
|
13
13
|
*/
|
|
14
14
|
titleTooltip?: ReactNode;
|
|
15
15
|
/** 帮组提示方向 */
|
|
16
|
-
placement?:
|
|
16
|
+
placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
17
17
|
/** 提示箭头 */
|
|
18
18
|
arrow?: boolean;
|
|
19
19
|
/** 提示信息icon */
|
|
@@ -34,7 +34,7 @@ export interface TitleProps {
|
|
|
34
34
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
35
35
|
};
|
|
36
36
|
/** 尺寸,仅在 icon 存在时有效 **/
|
|
37
|
-
size?:
|
|
37
|
+
size?: 'small' | 'medium' | 'large';
|
|
38
38
|
/** cls */
|
|
39
39
|
className?: string;
|
|
40
40
|
/** style */
|
package/Title/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var Title = function Title(props) {
|
|
|
31
31
|
icon = props.icon,
|
|
32
32
|
link = props.link,
|
|
33
33
|
_props$size = props.size,
|
|
34
|
-
size = _props$size === void 0 ?
|
|
34
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
35
35
|
className = props.className,
|
|
36
36
|
collapseClassName = props.collapseClassName,
|
|
37
37
|
titleTooltip = props.titleTooltip,
|
|
@@ -41,7 +41,7 @@ var Title = function Title(props) {
|
|
|
41
41
|
style = props.style;
|
|
42
42
|
var titleTextRef = useRef(null);
|
|
43
43
|
var linkTextRef = useRef(null);
|
|
44
|
-
var _useState = useState(
|
|
44
|
+
var _useState = useState('calc(100% - 20px)'),
|
|
45
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
46
|
descWith = _useState2[0],
|
|
47
47
|
setDescWith = _useState2[1];
|
|
@@ -93,7 +93,7 @@ var Title = function Title(props) {
|
|
|
93
93
|
})
|
|
94
94
|
})), link && jsx("a", Object.assign({
|
|
95
95
|
className: "title-link",
|
|
96
|
-
target: link.target ||
|
|
96
|
+
target: link.target || '_blank',
|
|
97
97
|
href: link.href,
|
|
98
98
|
onClick: link.onClick,
|
|
99
99
|
ref: linkTextRef
|
package/ToggleButton/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @date 2021/11/23 上午9:44
|
|
4
4
|
* @description toggleButton
|
|
5
5
|
*/
|
|
6
|
-
import React, { FunctionComponent } from
|
|
6
|
+
import React, { FunctionComponent } from 'react';
|
|
7
7
|
import ToggleButtonGroup, { ToggleButtonGroupProps, ToggleButtonItemProps } from './ToggleButtonGroup';
|
|
8
8
|
import './index.scss';
|
|
9
9
|
export interface ToggleButtonProps {
|
|
@@ -31,6 +31,10 @@ export interface ToggleButtonProps {
|
|
|
31
31
|
* 是否选中
|
|
32
32
|
*/
|
|
33
33
|
selected?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 是否单选
|
|
36
|
+
*/
|
|
37
|
+
exclusive?: boolean;
|
|
34
38
|
/**
|
|
35
39
|
* value
|
|
36
40
|
*/
|
package/ToggleButton/index.js
CHANGED
|
@@ -12,10 +12,10 @@ import '../_verture/typeof-adeedc13.js';
|
|
|
12
12
|
import '../_verture/slicedToArray-a8206399.js';
|
|
13
13
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
14
14
|
import '@para-ui/icons/LoadingF';
|
|
15
|
-
import '@para-ui/icons/Forbid';
|
|
16
15
|
import '../Tooltip/index.js';
|
|
17
16
|
import 'rc-tooltip';
|
|
18
17
|
import 'rc-tooltip/lib/placements';
|
|
18
|
+
import '@para-ui/icons/Forbid';
|
|
19
19
|
import '@para-ui/icons/Down';
|
|
20
20
|
import '../_verture/index-e9007d6a.js';
|
|
21
21
|
import 'rc-dropdown';
|
|
@@ -24,7 +24,7 @@ import 'dayjs';
|
|
|
24
24
|
import '../_verture/useFormatMessage-703f8b20.js';
|
|
25
25
|
import '@para-ui/core/GlobalContext';
|
|
26
26
|
|
|
27
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/23 上午9:50\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-toggle-button.paraui-v4-button-text {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button.paraui-v4-button-text:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-button-text:hover[disabled] {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button-wrap {\n display: inline-block;\n}\n.paraui-v4-toggle-button
|
|
27
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/23 上午9:50\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-toggle-button.paraui-v4-button-text {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button.paraui-v4-button-text:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-button-text:hover[disabled] {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button-wrap {\n display: inline-block;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-radio.paraui-v4-toggle-button-selected {\n border-color: rgb(46, 101, 230);\n color: rgb(255, 255, 255);\n background-color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-radio.paraui-v4-toggle-button-selected:hover {\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-radio:hover {\n border-color: rgb(87, 131, 235);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-radio[disabled] {\n color: rgb(161, 168, 179);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-radio[disabled]:hover {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-radio[disabled].paraui-v4-toggle-button-selected {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check::before {\n content: \" \";\n position: absolute;\n bottom: 0;\n right: 0;\n border: 8px solid rgb(212, 218, 227);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check::after {\n content: \" \";\n width: 8px;\n height: 8px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAM5JREFUOE/NkQENwjAURFcFIAEHgIM5YCgAHCABFBAUAA5wABI2CTgABeUd+V06BqFkCeEnl6X9d7d/vy7rWK6jPvu9gfe+z9QnsHDOlV9NgHhk4gpxrvjJBogL+DtwATkG12QDxEvIG3AzcRmW/5gAgsaR+1S54peht+c8s7vxc7+OAFHCIVhBWkfLUm6VliazRsUGAzoy6YEz0LaDeItYMVrVWCJ/nVuUmHhArPuX1XoFTI4wJ8au+NYb/ziBCJZdJqoiPFfyBO+I/2twBz0qQBFvrubpAAAAAElFTkSuQmCC\");\n background-size: 8px 8px;\n background-repeat: no-repeat;\n position: absolute;\n bottom: 1px;\n right: 1px;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check:hover {\n border-color: rgb(87, 131, 235);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check:hover::before {\n border-color: rgb(87, 131, 235);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check.paraui-v4-toggle-button-selected {\n border-color: rgb(46, 101, 230);\n color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check.paraui-v4-toggle-button-selected::before {\n border-color: rgb(46, 101, 230);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check[disabled] {\n color: rgb(161, 168, 179);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check[disabled]::before {\n border-color: rgb(212, 218, 227);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check[disabled]:hover {\n color: rgb(161, 168, 179);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check[disabled]:hover::before {\n border-color: rgb(212, 218, 227);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-check[disabled].paraui-v4-toggle-button-selected {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-toggle-button .toggle-button-text {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v4-toggle-button-disabled.paraui-v4-toggle-button {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button-disabled.paraui-v4-toggle-button:hover {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button .toggle-button-badge {\n position: absolute;\n right: 0;\n bottom: 16px;\n}\n.paraui-v4-toggle-button .toggle-button-badge > div {\n position: absolute;\n top: 0;\n right: 0;\n border: 8px solid rgb(46, 101, 230);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button .toggle-button-badge > svg {\n position: absolute;\n top: 7px;\n right: 1px;\n color: #fff;\n font-weight: 600;\n width: 8px;\n height: 8px;\n}\n\n.paraui-v4-togglebutton-group {\n display: flex;\n flex-flow: row wrap;\n}\n.paraui-v4-togglebutton-group .toggle-button-item {\n margin: 0 10px;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button {\n margin: 0;\n padding: 0 16px;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button[disabled] {\n color: rgb(161, 168, 179);\n background-color: transparent;\n border: 0;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button[disabled]:hover {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button ~ .paraui-v4-toggle-button::before {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n content: \"\";\n width: 1px;\n height: 14px;\n background-color: rgb(212, 218, 227);\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected {\n color: rgb(46, 101, 230);\n border: 0;\n font-weight: 700;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected[disabled] {\n color: rgb(29, 33, 38);\n background-color: transparent;\n border: 0;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected[disabled]:hover {\n background-color: transparent;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected:first-child:before {\n display: none;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected:not(:first-child)::before {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n content: \"\";\n width: 1px;\n height: 14px;\n background-color: rgb(212, 218, 227);\n border: 0;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected::after {\n display: none;\n}";
|
|
28
28
|
styleInject(css_248z);
|
|
29
29
|
|
|
30
30
|
//切换按钮组
|
|
@@ -86,14 +86,19 @@ var ToggleButtonGroup = function ToggleButtonGroup(props) {
|
|
|
86
86
|
selected = item.selected,
|
|
87
87
|
rest = __rest(item, ["label", "selected"]);
|
|
88
88
|
var hasSelected = selected === undefined ? hasValueSelected(rest.value, value) : selected;
|
|
89
|
-
return jsx(
|
|
90
|
-
|
|
91
|
-
selected: hasSelected,
|
|
92
|
-
autoToolTipOverflow: type !== 'text',
|
|
93
|
-
variant: type === 'text' ? 'text' : 'outlined',
|
|
94
|
-
onClick: exclusive ? handleExclusiveChange : handleChange
|
|
89
|
+
return jsx("div", Object.assign({
|
|
90
|
+
className: 'toggle-button-item'
|
|
95
91
|
}, {
|
|
96
|
-
children:
|
|
92
|
+
children: jsx(ToggleButton, Object.assign({}, rest, {
|
|
93
|
+
style: style,
|
|
94
|
+
selected: hasSelected,
|
|
95
|
+
autoToolTipOverflow: type !== 'text',
|
|
96
|
+
variant: type === 'text' ? 'text' : 'outlined',
|
|
97
|
+
onClick: exclusive ? handleExclusiveChange : handleChange,
|
|
98
|
+
exclusive: exclusive
|
|
99
|
+
}, {
|
|
100
|
+
children: label
|
|
101
|
+
}))
|
|
97
102
|
}), idx);
|
|
98
103
|
});
|
|
99
104
|
};
|
|
@@ -115,16 +120,18 @@ var ToggleButton = function ToggleButton(props) {
|
|
|
115
120
|
toolTipTitle = props.toolTipTitle,
|
|
116
121
|
_props$selected = props.selected,
|
|
117
122
|
selected = _props$selected === void 0 ? false : _props$selected,
|
|
123
|
+
_props$exclusive = props.exclusive,
|
|
124
|
+
exclusive = _props$exclusive === void 0 ? false : _props$exclusive,
|
|
118
125
|
value = props.value;
|
|
119
126
|
props.autoToolTipOverflow;
|
|
120
127
|
var width = props.width,
|
|
121
128
|
onClick = props.onClick,
|
|
122
|
-
restProps = __rest(props, ["className", "style", "children", "disabled", "toolTipTitle", "selected", "value", "autoToolTipOverflow", "width", "onClick"]);
|
|
129
|
+
restProps = __rest(props, ["className", "style", "children", "disabled", "toolTipTitle", "selected", "exclusive", "value", "autoToolTipOverflow", "width", "onClick"]);
|
|
123
130
|
// const [hasTip, setHasTip] = useState<boolean>(false);
|
|
124
131
|
var id = useRef(UUID()).current;
|
|
125
132
|
var prefixCls = "".concat($prefixCls, "-toggle-button");
|
|
126
133
|
//className
|
|
127
|
-
var makeCls = clsx(prefixCls, className, (_clsx = {}, _defineProperty(_clsx, "".concat(prefixCls, "-selected"), selected), _defineProperty(_clsx, "".concat(prefixCls, "-disabled"), disabled), _clsx));
|
|
134
|
+
var makeCls = clsx(prefixCls, className, (_clsx = {}, _defineProperty(_clsx, "".concat(prefixCls, "-").concat(exclusive ? 'radio' : 'check'), (restProps === null || restProps === void 0 ? void 0 : restProps.variant) !== 'text'), _defineProperty(_clsx, "".concat(prefixCls, "-selected"), selected), _defineProperty(_clsx, "".concat(prefixCls, "-disabled"), disabled), _clsx));
|
|
128
135
|
//点击事件
|
|
129
136
|
var handleClick = function handleClick(evt) {
|
|
130
137
|
if (onClick) onClick(evt, value);
|