@para-ui/core 3.0.4 → 3.0.7

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.
@@ -139,7 +139,6 @@ var Breadcrumbs = function Breadcrumbs(props) {
139
139
  setShowMore(false);
140
140
  }
141
141
 
142
- console.log(props.list, props.list.length);
143
142
  if (props.list.length <= constData.current.minNum + 1) return hideMask(); // 面包屑数组长度必须大于最少显示数
144
143
 
145
144
  if (constData.current.hidePos === props.list.length - constData.current.minNum - 1) return hideMask(); // 隐藏到最小显示数,停止
@@ -1,27 +1,10 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useRef, useEffect } from 'react';
3
3
  import { Transition } from 'react-transition-group';
4
+ import { g as getTransitionProps, a as getAutoHeightDuration } from '../_verture/util-a77b261e.js';
4
5
  import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
5
6
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
6
7
 
7
- function getTransitionProps(props, options) {
8
- var timeout = props.timeout,
9
- _props$style = props.style,
10
- style = _props$style === void 0 ? {} : _props$style;
11
- return {
12
- duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
13
- delay: style.transitionDelay
14
- };
15
- }
16
- function getAutoHeightDuration(height) {
17
- if (!height) {
18
- return 0;
19
- }
20
-
21
- var constant = height / 36;
22
- return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
23
- }
24
-
25
8
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-collapse-box {\n transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n width: 100%;\n overflow: hidden;\n height: 0;\n}\n.paraui-v3-collapse-box > .collapse-box-wrapper {\n display: flex;\n width: 100%;\n}\n.paraui-v3-collapse-box > .collapse-box-wrapper > .collapse-box-wrapper-inner {\n width: 100%;\n}\n.paraui-v3-collapse-box.paraui-v3-collapse-box-entered {\n overflow: visible;\n}\n.paraui-v3-collapse-box.paraui-v3-collapse-box-hidden {\n visibility: hidden;\n}";
26
9
  styleInject(css_248z);
27
10
 
@@ -0,0 +1,51 @@
1
+ import React, { FC } from 'react';
2
+ import './index.scss';
3
+ export interface CollapseLayoutProps {
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ /**
7
+ * 收起出现的位置
8
+ * 默认 left
9
+ */
10
+ type?: 'left' | 'right' | 'top' | 'bottom';
11
+ /**
12
+ * 普通展示数据
13
+ */
14
+ defaultContent?: React.ReactNode;
15
+ /**
16
+ * 显示隐藏的数据
17
+ */
18
+ displayContent?: React.ReactNode;
19
+ /**
20
+ * 展开还是收起
21
+ */
22
+ open?: boolean;
23
+ /**
24
+ * 允许缩放的长度
25
+ * */
26
+ zoomLength?: number;
27
+ /**
28
+ * 单位
29
+ * 默认px
30
+ */
31
+ unit?: string;
32
+ /**
33
+ * 展开按钮显示文字
34
+ */
35
+ showLabel?: string;
36
+ /**
37
+ * 收起按钮展示文字
38
+ */
39
+ hideLabel?: string;
40
+ /**
41
+ * 间距
42
+ * 默认20
43
+ */
44
+ spacing?: number;
45
+ }
46
+ /**
47
+ * @author zhanzl
48
+ * @date 2022/08/09
49
+ */
50
+ declare const CollapseLayout: FC<CollapseLayoutProps>;
51
+ export default CollapseLayout;
@@ -0,0 +1,190 @@
1
+ import { _ as _defineProperty } from '../_verture/defineProperty-0590dc61.js';
2
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { useRef, useState, useEffect } from 'react';
5
+ import DoubleLeft from '@para-ui/icons/DoubleLeft';
6
+ import DoubleRight from '@para-ui/icons/DoubleRight';
7
+ import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
8
+ import clsx from 'clsx';
9
+ import { a as getAutoHeightDuration } from '../_verture/util-a77b261e.js';
10
+ import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
11
+
12
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-collapse-layout {\n height: 100%;\n width: 100%;\n position: relative;\n overflow: hidden;\n}\n.paraui-v3-collapse-layout .collapse-layout-icon-transform-top {\n transform: rotate(90deg);\n}\n.paraui-v3-collapse-layout .collapse-layout-icon-transform-bottom {\n transform: rotate(-90deg);\n}\n.paraui-v3-collapse-layout .collapse-layout-icon-transform-right {\n transform: rotate(180deg);\n}\n.paraui-v3-collapse-layout .collapse-layout-display {\n overflow: hidden;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-click span, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-click span, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-click span, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-click span {\n font-size: 12px;\n font-weight: 400;\n text-align: center;\n color: rgb(54, 102, 214);\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-click {\n position: absolute;\n top: 50%;\n left: \"\";\n width: 20px;\n height: 72px;\n background: rgba(171, 176, 185, 0.12);\n text-align: center;\n cursor: pointer;\n line-height: 23px;\n margin-top: -36px;\n z-index: 1;\n display: grid;\n transition-property: right;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n right: 0px;\n border-radius: 4px 0 0 4px;\n border-right: 1px solid rgb(54, 102, 214);\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-click > svg {\n align-self: center;\n justify-self: center;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-display-shadow {\n transition-property: margin-right;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-click {\n position: absolute;\n top: 50%;\n left: 0;\n width: 20px;\n height: 72px;\n background: rgba(171, 176, 185, 0.12);\n text-align: center;\n cursor: pointer;\n line-height: 23px;\n margin-top: -36px;\n z-index: 1;\n display: grid;\n transition-property: left;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n border-left: 1px solid rgb(54, 102, 214);\n border-radius: 0 4px 4px 0;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-click > svg {\n align-self: center;\n justify-self: center;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-display-shadow {\n transition-property: margin-left;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left > div, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-right > div {\n display: inline-block;\n vertical-align: middle;\n height: 100%;\n position: relative;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-display-shadow, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-display-shadow {\n height: 100%;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-display,\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-left .collapse-layout-default, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-display,\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-right .collapse-layout-default {\n transition: width;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-click {\n position: absolute;\n top: 0;\n left: 50%;\n width: 72px;\n height: 20px;\n background: rgba(171, 176, 185, 0.12);\n text-align: center;\n cursor: pointer;\n line-height: 23px;\n margin-top: 0;\n z-index: 1;\n display: grid;\n transition-property: top;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n margin-left: -36px;\n border-top: 1px solid rgb(54, 102, 214);\n border-radius: 0 0 4px 4px;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-click > svg {\n align-self: center;\n justify-self: center;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-display-shadow {\n transition-property: margin-top;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-click {\n position: absolute;\n top: \"\";\n left: 50%;\n width: 72px;\n height: 20px;\n background: rgba(171, 176, 185, 0.12);\n text-align: center;\n cursor: pointer;\n line-height: 23px;\n margin-top: 0;\n z-index: 1;\n display: grid;\n transition-property: bottom;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n margin-left: -36px;\n bottom: 0px;\n border-bottom: 1px solid rgb(54, 102, 214);\n border-radius: 4px 4px 0 0;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-click > svg {\n align-self: center;\n justify-self: center;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-display-shadow {\n transition-property: margin-bottom;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-display,\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-default, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-display,\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-default {\n transition-property: height;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-delay: 0ms;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top .collapse-layout-display-shadow, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom .collapse-layout-display-shadow {\n width: 100%;\n}\n.paraui-v3-collapse-layout.paraui-v3-collapse-layout-top > div, .paraui-v3-collapse-layout.paraui-v3-collapse-layout-bottom > div {\n display: block;\n width: 100%;\n position: relative;\n}";
13
+ styleInject(css_248z);
14
+
15
+ /**
16
+ * @author zhanzl
17
+ * @date 2022/08/09
18
+ */
19
+
20
+ var CollapseLayout = function CollapseLayout(props) {
21
+ var _props$type = props.type,
22
+ type = _props$type === void 0 ? 'left' : _props$type,
23
+ showLabel = props.showLabel,
24
+ _props$open = props.open,
25
+ open = _props$open === void 0 ? false : _props$open,
26
+ hideLabel = props.hideLabel,
27
+ _props$spacing = props.spacing,
28
+ spacing = _props$spacing === void 0 ? 20 : _props$spacing,
29
+ _props$zoomLength = props.zoomLength,
30
+ zoomLength = _props$zoomLength === void 0 ? 0 : _props$zoomLength,
31
+ _props$unit = props.unit,
32
+ unit = _props$unit === void 0 ? 'px' : _props$unit,
33
+ style = props.style,
34
+ _props$className = props.className,
35
+ className = _props$className === void 0 ? '' : _props$className;
36
+ var displayRef = useRef(null);
37
+ /**
38
+ * 处理动画时间
39
+ * */
40
+
41
+ var handTime = function handTime() {
42
+ var dom = displayRef.current;
43
+ if (!dom) return 0;
44
+ var rect = dom.getBoundingClientRect();
45
+ var durationHand = getAutoHeightDuration(rect.width);
46
+ return durationHand;
47
+ };
48
+
49
+ var duration = handTime(); // 动画时间
50
+
51
+ /**
52
+ * 当前为收起还是展开
53
+ */
54
+
55
+ var _useState = useState(),
56
+ _useState2 = _slicedToArray(_useState, 2),
57
+ showBox = _useState2[0],
58
+ setShowBox = _useState2[1]; // 渲染配置
59
+
60
+
61
+ var typeConfig = {
62
+ layout: {
63
+ left: ['display', 'default'],
64
+ right: ['default', 'display'],
65
+ top: ['display', 'default'],
66
+ bottom: ['default', 'display']
67
+ }
68
+ }; // 首字母大写
69
+
70
+ var formatterType = function formatterType(str) {
71
+ var newStr = str.slice(0, 1).toUpperCase() + str.slice(1);
72
+ return newStr;
73
+ }; // 计算方位
74
+
75
+
76
+ var hangWH = function hangWH() {
77
+ var wH = 'width';
78
+
79
+ if (type === "top" || type === "bottom") {
80
+ wH = 'height';
81
+ }
82
+
83
+ return wH;
84
+ }; // 收缩容器的样式
85
+
86
+
87
+ var handDisplayStyle = function handDisplayStyle() {
88
+ var json = {};
89
+ var collapseL = (showBox ? zoomLength : 0) + unit; // 收缩长度
90
+
91
+ var wH = hangWH();
92
+ json[wH] = collapseL;
93
+ json['transitionDuration'] = duration + 'ms';
94
+ return json;
95
+ }; // 收缩容器的样式,里面的样式
96
+
97
+
98
+ var handDisplayShowStyle = function handDisplayShowStyle() {
99
+ var json = {};
100
+ var direction = "margin".concat(formatterType(type));
101
+ var wH = hangWH();
102
+ json[wH] = zoomLength + unit;
103
+ json[direction] = (showBox ? 0 : zoomLength) + unit;
104
+ json['transitionDuration'] = duration + 'ms';
105
+ return json;
106
+ }; // 自适应容器的样式
107
+
108
+
109
+ var handDefaultStyle = function handDefaultStyle() {
110
+ var json = {};
111
+ var wH = hangWH();
112
+ var collapseL = showBox ? zoomLength : 0; // 收缩长度
113
+
114
+ json[wH] = "calc(100% - ".concat(collapseL + spacing).concat(unit);
115
+ var direction = "margin".concat(formatterType(type));
116
+ json[direction] = spacing + unit;
117
+ json['transitionDuration'] = duration + 'ms';
118
+ return json;
119
+ }; // 布局
120
+
121
+
122
+ var Layout = function Layout() {
123
+ return typeConfig.layout[type].map(function (key, idx) {
124
+ switch (key) {
125
+ case "display":
126
+ // 可收缩的
127
+ return jsx("div", Object.assign({
128
+ className: "collapse-layout-display",
129
+ style: handDisplayStyle()
130
+ }, {
131
+ children: jsx("div", Object.assign({
132
+ className: "collapse-layout-display-shadow",
133
+ style: handDisplayShowStyle(),
134
+ ref: displayRef
135
+ }, {
136
+ children: props.displayContent
137
+ }))
138
+ }), idx);
139
+
140
+ default:
141
+ return jsx("div", Object.assign({
142
+ className: "collapse-layout-default",
143
+ style: handDefaultStyle()
144
+ }, {
145
+ children: props.defaultContent
146
+ }), idx);
147
+ }
148
+ });
149
+ };
150
+ /**
151
+ * 展开收起按钮
152
+ * */
153
+
154
+
155
+ var handBtn = function handBtn() {
156
+ var _style;
157
+
158
+ /**
159
+ * 计算后的展示文字
160
+ */
161
+ var computeLabel = showBox ? showLabel : hideLabel;
162
+ return jsxs("div", Object.assign({
163
+ className: "collapse-layout-click collapse-layout-click-label-".concat(!!computeLabel),
164
+ style: (_style = {}, _defineProperty(_style, type, "".concat(showBox ? zoomLength : 0).concat(unit)), _defineProperty(_style, "transitionDuration", duration + 'ms'), _style),
165
+ onClick: function onClick() {
166
+ return setShowBox(!showBox);
167
+ }
168
+ }, {
169
+ children: [computeLabel && jsx("span", {
170
+ children: computeLabel
171
+ }), showBox ? jsx(DoubleLeft, {
172
+ className: "collapse-layout-icon-transform-".concat(type)
173
+ }) : jsx(DoubleRight, {
174
+ className: "collapse-layout-icon-transform-".concat(type)
175
+ })]
176
+ }));
177
+ };
178
+
179
+ useEffect(function () {
180
+ setShowBox(open);
181
+ }, [open]);
182
+ return jsxs("div", Object.assign({
183
+ className: clsx("".concat($prefixCls, "-collapse-layout"), "".concat($prefixCls, "-collapse-layout-").concat(showBox), "".concat($prefixCls, "-collapse-layout-").concat(type), "".concat($prefixCls, "-collapse-layout-").concat(type, "-").concat(showBox), className),
184
+ style: style
185
+ }, {
186
+ children: [handBtn(), Layout()]
187
+ }));
188
+ };
189
+
190
+ export { CollapseLayout as default };
package/Form/index.js CHANGED
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
  import { DeepClone } from '@paraview/lib';
5
5
  import React__default from 'react';
6
- import { F as FormItem, v as validate } from '../_verture/index-4b4ee8b5.js';
6
+ import { F as FormItem, v as validate } from '../_verture/index-7b63f88e.js';
7
7
  import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
8
8
  import '../TextField/index.js';
9
9
  import '../_verture/typeof-498dd2b1.js';
package/FormItem/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { F as default } from '../_verture/index-4b4ee8b5.js';
3
+ export { F as default } from '../_verture/index-7b63f88e.js';
4
4
  import 'clsx';
5
5
  import '../Label/index.js';
6
6
  import '../_verture/constant-bf34e6fa.js';
package/Menu/index.js CHANGED
@@ -12,6 +12,7 @@ import MenuMoreLine from '@para-ui/icons/IndentRightFill';
12
12
  import MenuLessLine from '@para-ui/icons/IndentLeftFill';
13
13
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
14
14
  import 'react-transition-group';
15
+ import '../_verture/util-a77b261e.js';
15
16
 
16
17
  var Logo = function Logo(props) {
17
18
  var _props$expansion = props.expansion,
@@ -2,8 +2,8 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import React__default, { useState, useRef, useEffect, useMemo } from 'react';
4
4
  import PaginationCom from 'rc-pagination';
5
- import FirstPage from '@para-ui/icons/DoubleLeft';
6
- import LastPage from '@para-ui/icons/DoubleRight';
5
+ import DoubleLeft from '@para-ui/icons/DoubleLeft';
6
+ import DoubleRight from '@para-ui/icons/DoubleRight';
7
7
  import NavigateBefore from '@para-ui/icons/Left';
8
8
  import Right from '@para-ui/icons/Right';
9
9
  import Select from '../Select/index.js';
@@ -398,7 +398,7 @@ var Pagination = function Pagination(props) {
398
398
  onClick: clickPage('first'),
399
399
  className: pageCom === 1 ? 'disabled-btn' : ''
400
400
  }, {
401
- children: jsx(FirstPage, {})
401
+ children: jsx(DoubleLeft, {})
402
402
  })), jsx("div", Object.assign({
403
403
  onClick: clickPage('prev'),
404
404
  className: pageCom === 1 ? 'disabled-btn' : ''
@@ -426,7 +426,7 @@ var Pagination = function Pagination(props) {
426
426
  onClick: clickPage('last'),
427
427
  className: pageCom === totalPage ? 'disabled-btn' : ''
428
428
  }, {
429
- children: jsx(LastPage, {})
429
+ children: jsx(DoubleRight, {})
430
430
  }))]
431
431
  }))]
432
432
  }));
package/README.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 版本: 3.0.6
2
+
3
+ para-ui/core@3.0.6 发布
4
+ 【TextEditor】新增富文本编辑器
5
+
6
+ ## 版本: 3.0.5
7
+
8
+ para-ui/core@3.0.5 发布
9
+ 【CollapseLayout】分栏收缩容器
10
+
1
11
  ## 版本: 3.0.4
2
12
 
3
13
  para-ui/core@3.0.4 发布
@@ -5,6 +15,7 @@
5
15
  【Button】禁用时提示文字无箭头且位于下方
6
16
  【国际化】国际化支持zh-CN/en-US
7
17
  【Breadcrumbs】重构面包屑
18
+ 【Transfer】增加禁用逻辑,修改value改变不生效
8
19
 
9
20
  ## 版本: 3.0.3
10
21
 
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @author xh
3
+ * @date 2022/09/06 18:00
4
+ * @description 存放富文本编辑器的一些默认配置
5
+ */
6
+ export declare const TOOL_BAR_CONFIG: (string | {
7
+ key: string;
8
+ title: string;
9
+ iconSvg: string;
10
+ menuKeys: string[];
11
+ })[];
@@ -0,0 +1,106 @@
1
+ /**
2
+ * @author xh
3
+ * @date 2022/09/06 11:26
4
+ * @description 基于wangEditor的富文本编辑器
5
+ */
6
+ import React, { ReactNode } from 'react';
7
+ import { LabelTooltipProps } from "../Label";
8
+ import { IDomEditor } from '@wangeditor/editor';
9
+ import { HelperTextDetailProps } from "../HelperText";
10
+ import './index.scss';
11
+ import '@wangeditor/editor/dist/css/style.css';
12
+ declare type InsertFnType = (url: string, alt: string, href: string) => void;
13
+ export interface IMenuGroup {
14
+ key: string;
15
+ title: string;
16
+ iconSvg?: string;
17
+ menuKeys: string[];
18
+ }
19
+ export interface UpLoadImgConfig {
20
+ fieldName: string;
21
+ maxFileSize: number;
22
+ maxNumberOfFiles: number;
23
+ allowedFileTypes: string[];
24
+ meta: object;
25
+ metaWithUrl: boolean;
26
+ headers: object;
27
+ withCredentials: boolean;
28
+ timeout: number;
29
+ base64LimitSize: number;
30
+ onSuccess: (file: File, res: any) => void;
31
+ onFailed: (file: File, res: any) => void;
32
+ onProgress: (progress: number) => void;
33
+ onBeforeUpload: (file: File) => any;
34
+ onError: (file: File, err: any, res: any) => void;
35
+ customUpload: (file: File, insertFn: InsertFnType) => void;
36
+ customInsert: (res: any, insertFn: InsertFnType) => void;
37
+ }
38
+ export declare type UpLoadVideoConfig = Omit<UpLoadImgConfig, 'base64LimitSize'>;
39
+ export interface TextEditorProps extends HelperTextDetailProps {
40
+ /** 样式class */
41
+ className?: string;
42
+ /** style */
43
+ style?: React.CSSProperties;
44
+ /** toolbarStyle */
45
+ toolbarStyle?: React.CSSProperties;
46
+ /** editorStyle */
47
+ editorStyle?: React.CSSProperties;
48
+ /** 富文本的最大长度 */
49
+ max?: number;
50
+ /** 标题 */
51
+ label?: ReactNode;
52
+ /** 标题提示 */
53
+ labelSign?: ReactNode;
54
+ /** 帮组提示信息 */
55
+ labelTooltip?: LabelTooltipProps;
56
+ /** 提示语 */
57
+ placeholder?: string;
58
+ /** 编辑器是否默认聚焦 */
59
+ autoFocus?: boolean;
60
+ /** 只读 */
61
+ readOnly?: boolean;
62
+ /** 是否必填 */
63
+ required?: boolean;
64
+ /** 默认值 不受控 */
65
+ defaultValue?: string;
66
+ /** 默认值 受控 */
67
+ value?: string;
68
+ /** 工具栏菜单配置*/
69
+ toolbarKeys?: Array<string | IMenuGroup>;
70
+ /** 工具栏不需要的配置 */
71
+ excludeKeys?: string[];
72
+ /** 工具栏插入新菜单 */
73
+ insertKeys?: {
74
+ index: number;
75
+ keys: string | Array<string | IMenuGroup>;
76
+ };
77
+ /** 文件上传的服务地址 */
78
+ server: string;
79
+ /** 上传图片配置 */
80
+ uploadImage?: Partial<UpLoadImgConfig>;
81
+ /** 上传视频配置 */
82
+ uploadVideo?: Partial<UpLoadVideoConfig>;
83
+ /** 改变事件 */
84
+ onChange?: (value: string, text: string) => void;
85
+ /** 失去焦点 */
86
+ onBlur?: (editor: IDomEditor) => void;
87
+ /** 得到焦点 */
88
+ onFocus?: (editor: IDomEditor) => void;
89
+ /** 编辑器销毁钩子 */
90
+ onDestroyed?: (editor: IDomEditor) => void;
91
+ [name: string]: any;
92
+ }
93
+ export interface TextEditorRef {
94
+ /** 获取html内容 */
95
+ getContent: () => string | undefined;
96
+ /** 获取纯文本内容 */
97
+ getText: () => string | undefined;
98
+ /** 清空编辑器 */
99
+ clearEditor: () => void;
100
+ /** 设置content */
101
+ setContent: (content: string) => void;
102
+ /** 获取编辑器实例 */
103
+ getEditor: () => IDomEditor | null;
104
+ }
105
+ declare const TextEditor: React.ForwardRefExoticComponent<Pick<TextEditorProps, keyof TextEditorProps> & React.RefAttributes<TextEditorRef>>;
106
+ export default TextEditor;
@@ -0,0 +1,294 @@
1
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { forwardRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';
4
+ import Label from '../Label/index.js';
5
+ import { Toolbar, Editor } from '@wangeditor/editor-for-react';
6
+ import HelperText from '../HelperText/index.js';
7
+ import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
8
+ import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
9
+ import '../Help/index.js';
10
+ import '../_verture/tslib.es6-55ed4bd2.js';
11
+ import '../Tooltip/index.js';
12
+ import 'rc-tooltip';
13
+ import 'rc-tooltip/lib/placements';
14
+ import 'clsx';
15
+ import '@para-ui/icons/Help';
16
+
17
+ /**
18
+ * @author xh
19
+ * @date 2022/09/06 18:00
20
+ * @description 存放富文本编辑器的一些默认配置
21
+ */
22
+ var TOOL_BAR_CONFIG = ["headerSelect", "blockquote", "|", "bold", "underline", "italic", {
23
+ key: 'group-more-style',
24
+ title: '更多',
25
+ 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>",
26
+ menuKeys: ['through', 'code', 'sup', 'sub', 'clearStyle']
27
+ }, "color", "bgColor", "|", "fontSize", "fontFamily", "lineHeight", "|", "bulletedList", "numberedList", "todo", {
28
+ key: 'group-justify',
29
+ title: '对齐',
30
+ 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>",
31
+ menuKeys: ['justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify']
32
+ }, {
33
+ key: 'group-indent',
34
+ title: '缩进',
35
+ iconSvg: "<svg viewBox=\"0 0 1024 1024\"><path d=\"M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z\"></path></svg>",
36
+ menuKeys: ['indent', 'delIndent']
37
+ }, "|", "emotion", "insertLink", {
38
+ key: 'group-image',
39
+ title: '图片',
40
+ 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>",
41
+ menuKeys: ['insertImage', 'uploadImage']
42
+ }, {
43
+ key: "group-video",
44
+ title: "视频",
45
+ 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>",
46
+ menuKeys: ['insertVideo', 'uploadVideo']
47
+ }, "insertTable", "codeBlock", "divider", "|", "undo", "redo", "|", "fullScreen"];
48
+
49
+ var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-text-editor .text-editor-content {\n border: 1px solid rgba(171, 176, 185, 0.4);\n z-index: 100;\n}";
50
+ styleInject(css_248z$1);
51
+
52
+ var css_248z = ":root,\n:host {\n --w-e-textarea-bg-color: #fff;\n --w-e-textarea-color: #333;\n --w-e-textarea-border-color: #ccc;\n --w-e-textarea-slight-border-color: #e8e8e8;\n --w-e-textarea-slight-color: #d4d4d4;\n --w-e-textarea-slight-bg-color: #f5f2f0;\n --w-e-textarea-selected-border-color: #B4D5FF;\n --w-e-textarea-handler-bg-color: #4290f7;\n --w-e-toolbar-color: #595959;\n --w-e-toolbar-bg-color: #fff;\n --w-e-toolbar-active-color: #333;\n --w-e-toolbar-active-bg-color: #f1f1f1;\n --w-e-toolbar-disabled-color: #999;\n --w-e-toolbar-border-color: #e8e8e8;\n --w-e-modal-button-bg-color: #fafafa;\n --w-e-modal-button-border-color: #d9d9d9;\n}\n\n.w-e-text-container *,.w-e-toolbar *{box-sizing:border-box;margin:0;outline:none;padding:0}.w-e-text-container blockquote,.w-e-text-container li,.w-e-text-container p,.w-e-text-container td,.w-e-text-container th,.w-e-toolbar *{line-height:1.5}.w-e-text-container{background-color:var(--w-e-textarea-bg-color);color:var(--w-e-textarea-color);height:100%;position:relative}.w-e-text-container .w-e-scroll{-webkit-overflow-scrolling:touch;height:100%}.w-e-text-container [data-slate-editor]{word-wrap:break-word;border-top:1px solid transparent;min-height:100%;outline:0;padding:0 10px;white-space:pre-wrap}.w-e-text-container [data-slate-editor] p{margin:15px 0}.w-e-text-container [data-slate-editor] h1,.w-e-text-container [data-slate-editor] h2,.w-e-text-container [data-slate-editor] h3,.w-e-text-container [data-slate-editor] h4,.w-e-text-container [data-slate-editor] h5{margin:20px 0}.w-e-text-container [data-slate-editor] img{cursor:default;display:inline!important;max-width:100%;min-height:20px;min-width:20px}.w-e-text-container [data-slate-editor] span{text-indent:0}.w-e-text-container [data-slate-editor] [data-selected=true]{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-placeholder{font-style:italic;left:10px;top:17px;width:90%}.w-e-max-length-info,.w-e-text-placeholder{color:var(--w-e-textarea-slight-color);pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.w-e-max-length-info{bottom:.5em;right:1em}.w-e-bar{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-color);font-size:14px;padding:0 5px}.w-e-bar svg{fill:var(--w-e-toolbar-color);height:14px;width:14px}.w-e-bar-show{display:flex}.w-e-bar-hidden{display:none}.w-e-hover-bar{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 5px #0000001f;position:absolute}.w-e-toolbar{flex-wrap:wrap;position:relative}.w-e-bar-divider{background-color:var(--w-e-toolbar-border-color);display:inline-flex;height:40px;margin:0 5px;width:1px}.w-e-bar-item{display:flex;height:40px;padding:4px;position:relative;text-align:center}.w-e-bar-item,.w-e-bar-item button{align-items:center;justify-content:center}.w-e-bar-item button{background:transparent;border:none;color:var(--w-e-toolbar-color);cursor:pointer;display:inline-flex;height:32px;overflow:hidden;padding:0 8px;white-space:nowrap}.w-e-bar-item button:hover{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item button .title{margin-left:5px}.w-e-bar-item .active{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item .disabled{color:var(--w-e-toolbar-disabled-color);cursor:not-allowed}.w-e-bar-item .disabled svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-menu-tooltip-v5:before{background-color:var(--w-e-toolbar-active-color);border-radius:5px;color:var(--w-e-toolbar-bg-color);content:attr(data-tooltip);font-size:.75em;opacity:0;padding:5px 10px;position:absolute;text-align:center;top:40px;transition:opacity .6s;visibility:hidden;white-space:pre;z-index:1}.w-e-menu-tooltip-v5:after{border:5px solid transparent;border-bottom:5px solid var(--w-e-toolbar-active-color);content:\"\";opacity:0;position:absolute;top:30px;transition:opacity .6s;visibility:hidden}.w-e-menu-tooltip-v5:hover:after,.w-e-menu-tooltip-v5:hover:before{opacity:1;visibility:visible}.w-e-menu-tooltip-v5.tooltip-right:before{left:100%;top:10px}.w-e-menu-tooltip-v5.tooltip-right:after{border-bottom-color:transparent;border-left-color:transparent;border-right-color:var(--w-e-toolbar-active-color);border-top-color:transparent;left:100%;margin-left:-10px;top:16px}.w-e-bar-item-group .w-e-bar-item-menus-container{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;display:none;left:0;margin-top:40px;position:absolute;top:0;z-index:1}.w-e-bar-item-group:hover .w-e-bar-item-menus-container{display:block}.w-e-select-list{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;left:0;margin-top:40px;max-height:350px;min-width:100px;overflow-y:auto;position:absolute;top:0;z-index:1}.w-e-select-list ul{line-height:1;list-style:none}.w-e-select-list ul .selected{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li{cursor:pointer;padding:7px 0 7px 25px;position:relative;text-align:left;white-space:nowrap}.w-e-select-list ul li:hover{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li svg{left:0;margin-left:5px;margin-top:-7px;position:absolute;top:50%}.w-e-bar-bottom .w-e-select-list{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-drop-panel{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;margin-top:40px;min-width:200px;padding:10px;position:absolute;top:0;z-index:1}.w-e-bar-bottom .w-e-drop-panel{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-modal{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;color:var(--w-e-toolbar-color);font-size:14px;min-height:40px;min-width:100px;padding:20px 15px 0;position:absolute;text-align:left;z-index:1}.w-e-modal .btn-close{cursor:pointer;line-height:1;padding:5px;position:absolute;right:8px;top:7px}.w-e-modal .btn-close svg{fill:var(--w-e-toolbar-color);height:10px;width:10px}.w-e-modal .babel-container{display:block;margin-bottom:15px}.w-e-modal .babel-container span{display:block;margin-bottom:10px}.w-e-modal .button-container{margin-bottom:15px}.w-e-modal button{background-color:var(--w-e-modal-button-bg-color);border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color);cursor:pointer;font-weight:400;height:32px;padding:4.5px 15px;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.w-e-modal input[type=number],.w-e-modal input[type=text],.w-e-modal textarea{font-feature-settings:\"tnum\";background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color);font-variant:tabular-nums;padding:4.5px 11px;transition:all .3s;width:100%}.w-e-modal textarea{min-height:60px}body .w-e-modal,body .w-e-modal *{box-sizing:border-box}.w-e-progress-bar{background-color:var(--w-e-textarea-handler-bg-color);height:1px;position:absolute;transition:width .3s;width:0}.w-e-full-screen-container{bottom:0!important;display:flex!important;flex-direction:column!important;height:100%!important;left:0!important;margin:0!important;padding:0!important;position:fixed;right:0!important;top:0!important;width:100%!important}.w-e-full-screen-container [data-w-e-textarea=true]{flex:1!important}\n.w-e-text-container [data-slate-editor] code{background-color:var(--w-e-textarea-slight-bg-color);border-radius:3px;font-family:monospace;padding:3px}.w-e-panel-content-color{list-style:none;text-align:left;width:230px}.w-e-panel-content-color li{border:1px solid var(--w-e-toolbar-bg-color);border-radius:3px 3px;cursor:pointer;display:inline-block;padding:2px}.w-e-panel-content-color li:hover{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color li .color-block{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px 3px;height:17px;width:17px}.w-e-panel-content-color .active{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color .clear{line-height:1.5;margin-bottom:5px;width:100%}.w-e-panel-content-color .clear svg{height:16px;margin-bottom:-4px;width:16px}.w-e-text-container [data-slate-editor] blockquote{background-color:var(--w-e-textarea-slight-bg-color);border-left:8px solid var(--w-e-textarea-selected-border-color);display:block;font-size:100%;line-height:1.5;margin:10px 0;padding:10px}.w-e-panel-content-emotion{font-size:20px;list-style:none;text-align:left;width:300px}.w-e-panel-content-emotion li{border-radius:3px 3px;cursor:pointer;display:inline-block;padding:0 5px}.w-e-panel-content-emotion li:hover{background-color:var(--w-e-textarea-slight-bg-color)}.w-e-textarea-divider{border-radius:3px;margin:20px auto;padding:20px}.w-e-textarea-divider hr{background-color:var(--w-e-textarea-border-color);border:0;display:block;height:1px}.w-e-text-container [data-slate-editor] pre>code{background-color:var(--w-e-textarea-slight-bg-color);border:1px solid var(--w-e-textarea-slight-border-color);border-radius:4px 4px;display:block;font-size:14px;padding:10px;text-indent:0}.w-e-text-container [data-slate-editor] .w-e-image-container{display:inline-block;margin:0 10px}.w-e-text-container [data-slate-editor] .w-e-image-container:hover{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-container [data-slate-editor] .w-e-selected-image-container{overflow:hidden;position:relative}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .w-e-image-dragger{background-color:var(--w-e-textarea-handler-bg-color);height:7px;position:absolute;width:7px}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-top{cursor:nwse-resize;left:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-top{cursor:nesw-resize;right:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-bottom{bottom:0;cursor:nesw-resize;left:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-bottom{bottom:0;cursor:nwse-resize;right:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container:hover{box-shadow:none}.w-e-text-container [contenteditable=false] .w-e-image-container:hover{box-shadow:none}\n.w-e-text-container [data-slate-editor] ol,.w-e-text-container [data-slate-editor] ul{padding-left:20px}.w-e-text-container [data-slate-editor] li{line-height:inherit;margin:10px 0}\n.w-e-text-container [data-slate-editor] .table-container{border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin-top:10px;overflow-x:auto;padding:10px;width:100%}.w-e-text-container [data-slate-editor] table{border-collapse:collapse}.w-e-text-container [data-slate-editor] table td,.w-e-text-container [data-slate-editor] table th{border:1px solid var(--w-e-textarea-border-color);line-height:1.5;min-width:30px;padding:3px 5px;text-align:left}.w-e-text-container [data-slate-editor] table th{background-color:var(--w-e-textarea-slight-bg-color);font-weight:700;text-align:center}.w-e-panel-content-table{background-color:var(--w-e-toolbar-bg-color)}.w-e-panel-content-table table{border-collapse:collapse}.w-e-panel-content-table td{border:1px solid var(--w-e-toolbar-border-color);cursor:pointer;height:15px;padding:3px 5px;width:20px}.w-e-panel-content-table td.active{background-color:var(--w-e-toolbar-active-bg-color)}\n.w-e-textarea-video-container{background-image:linear-gradient(45deg,#eee 25%,transparent 0,transparent 75%,#eee 0,#eee),linear-gradient(45deg,#eee 25%,#fff 0,#fff 75%,#eee 0,#eee);background-position:0 0,10px 10px;background-size:20px 20px;border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin:10px auto 0;padding:10px 0;text-align:center}\n\n.w-e-text-container [data-slate-editor] pre>code{word-wrap:normal;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;-webkit-hyphens:none;hyphens:none;line-height:1.5;margin:.5em 0;overflow:auto;padding:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;text-shadow:0 1px #fff;white-space:pre;word-break:normal;word-spacing:normal}.w-e-text-container [data-slate-editor] pre>code .token.cdata,.w-e-text-container [data-slate-editor] pre>code .token.comment,.w-e-text-container [data-slate-editor] pre>code .token.doctype,.w-e-text-container [data-slate-editor] pre>code .token.prolog{color:#708090}.w-e-text-container [data-slate-editor] pre>code .token.punctuation{color:#999}.w-e-text-container [data-slate-editor] pre>code .token.namespace{opacity:.7}.w-e-text-container [data-slate-editor] pre>code .token.boolean,.w-e-text-container [data-slate-editor] pre>code .token.constant,.w-e-text-container [data-slate-editor] pre>code .token.deleted,.w-e-text-container [data-slate-editor] pre>code .token.number,.w-e-text-container [data-slate-editor] pre>code .token.property,.w-e-text-container [data-slate-editor] pre>code .token.symbol,.w-e-text-container [data-slate-editor] pre>code .token.tag{color:#905}.w-e-text-container [data-slate-editor] pre>code .token.attr-name,.w-e-text-container [data-slate-editor] pre>code .token.builtin,.w-e-text-container [data-slate-editor] pre>code .token.char,.w-e-text-container [data-slate-editor] pre>code .token.inserted,.w-e-text-container [data-slate-editor] pre>code .token.selector,.w-e-text-container [data-slate-editor] pre>code .token.string{color:#690}.w-e-text-container [data-slate-editor] pre>code .language-css .token.string,.w-e-text-container [data-slate-editor] pre>code .style .token.string,.w-e-text-container [data-slate-editor] pre>code .token.entity,.w-e-text-container [data-slate-editor] pre>code .token.operator,.w-e-text-container [data-slate-editor] pre>code .token.url{color:#9a6e3a}.w-e-text-container [data-slate-editor] pre>code .token.atrule,.w-e-text-container [data-slate-editor] pre>code .token.attr-value,.w-e-text-container [data-slate-editor] pre>code .token.keyword{color:#07a}.w-e-text-container [data-slate-editor] pre>code .token.class-name,.w-e-text-container [data-slate-editor] pre>code .token.function{color:#dd4a68}.w-e-text-container [data-slate-editor] pre>code .token.important,.w-e-text-container [data-slate-editor] pre>code .token.regex,.w-e-text-container [data-slate-editor] pre>code .token.variable{color:#e90}.w-e-text-container [data-slate-editor] pre>code .token.bold,.w-e-text-container [data-slate-editor] pre>code .token.important{font-weight:700}.w-e-text-container [data-slate-editor] pre>code .token.italic{font-style:italic}.w-e-text-container [data-slate-editor] pre>code .token.entity{cursor:help}";
53
+ styleInject(css_248z);
54
+
55
+ var TextEditor = /*#__PURE__*/forwardRef(function (props, ref) {
56
+ var style = props.style,
57
+ _props$toolbarStyle = props.toolbarStyle,
58
+ toolbarStyle = _props$toolbarStyle === void 0 ? {
59
+ borderBottom: '1px solid #ccc'
60
+ } : _props$toolbarStyle,
61
+ _props$editorStyle = props.editorStyle,
62
+ editorStyle = _props$editorStyle === void 0 ? {
63
+ height: '300px',
64
+ overflowY: 'hidden'
65
+ } : _props$editorStyle,
66
+ hideErrorDom = props.hideErrorDom,
67
+ className = props.className,
68
+ error = props.error,
69
+ server = props.server,
70
+ helperText = props.helperText,
71
+ required = props.required,
72
+ labelSign = props.labelSign,
73
+ label = props.label,
74
+ labelTooltip = props.labelTooltip,
75
+ _props$placeholder = props.placeholder,
76
+ placeholder = _props$placeholder === void 0 ? '请输入内容' : _props$placeholder,
77
+ onChange = props.onChange,
78
+ onFocus = props.onFocus,
79
+ onBlur = props.onBlur,
80
+ onDestroyed = props.onDestroyed,
81
+ _props$readOnly = props.readOnly,
82
+ readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
83
+ _props$autoFocus = props.autoFocus,
84
+ autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,
85
+ max = props.max,
86
+ defaultValue = props.defaultValue,
87
+ value = props.value,
88
+ excludeKeys = props.excludeKeys,
89
+ insertKeys = props.insertKeys,
90
+ _props$toolbarKeys = props.toolbarKeys,
91
+ toolbarKeys = _props$toolbarKeys === void 0 ? TOOL_BAR_CONFIG : _props$toolbarKeys,
92
+ _props$uploadImage = props.uploadImage,
93
+ uploadImage = _props$uploadImage === void 0 ? {
94
+ base64LimitSize: 2 * 1024 * 1024,
95
+ timeout: 15 * 1000
96
+ } : _props$uploadImage,
97
+ _props$uploadVideo = props.uploadVideo,
98
+ uploadVideo = _props$uploadVideo === void 0 ? {
99
+ timeout: 15 * 1000
100
+ } : _props$uploadVideo; // editor 实例
101
+
102
+ var _useState = useState(null),
103
+ _useState2 = _slicedToArray(_useState, 2),
104
+ editor = _useState2[0],
105
+ setEditor = _useState2[1]; // 编辑器内容
106
+
107
+
108
+ var _useState3 = useState(''),
109
+ _useState4 = _slicedToArray(_useState3, 2),
110
+ valueCom = _useState4[0],
111
+ setValueCom = _useState4[1]; // 组件值
112
+ // 非受控组件赋值
113
+
114
+
115
+ useEffect(function () {
116
+ if (defaultValue !== undefined) {
117
+ setValueCom(defaultValue);
118
+ }
119
+ }, []); // 受控组件监听value变化赋值
120
+
121
+ useEffect(function () {
122
+ if (value !== undefined) {
123
+ setValueCom(value);
124
+ }
125
+ }, [value]); // 获取html格式的内容
126
+
127
+ var getContent = function getContent() {
128
+ if (!editor) return;
129
+ return editor.getHtml();
130
+ }; // 获取纯文本
131
+
132
+
133
+ var getText = function getText() {
134
+ if (!editor) return;
135
+ return editor.getText();
136
+ }; // 清空编辑器
137
+
138
+
139
+ var clearEditor = function clearEditor() {
140
+ if (!editor) return;
141
+ editor.clear();
142
+ }; //设置值
143
+
144
+
145
+ var setContent = function setContent(content) {
146
+ if (!editor) return;
147
+ editor.setHtml(content); // 重新聚焦放到下一次事件队列,否则会有bug
148
+
149
+ setTimeout(function () {
150
+ editor.focus(true);
151
+ });
152
+ }; // 获取富文本实例
153
+
154
+
155
+ var getEditor = function getEditor() {
156
+ return editor;
157
+ }; // 销毁 editor
158
+
159
+
160
+ useEffect(function () {
161
+ return function () {
162
+ if (editor == null) return;
163
+ editor.destroy();
164
+ setEditor(null);
165
+ };
166
+ }, [editor]);
167
+ useImperativeHandle(ref, function () {
168
+ return {
169
+ getContent: getContent,
170
+ getText: getText,
171
+ clearEditor: clearEditor,
172
+ setContent: setContent,
173
+ getEditor: getEditor
174
+ };
175
+ });
176
+ /** 聚焦 */
177
+
178
+ var onFocusCom = function onFocusCom(editor) {
179
+ onFocus && onFocus(editor);
180
+ };
181
+ /** 失去焦点 */
182
+
183
+
184
+ var onBlurCom = function onBlurCom(editor) {
185
+ onBlur && onBlur(editor);
186
+ };
187
+ /** 销毁钩子 */
188
+
189
+
190
+ var onDestroyedCom = function onDestroyedCom(editor) {
191
+ onDestroyed && onDestroyed(editor);
192
+ }; // 工具栏配置
193
+
194
+
195
+ var toolbarConfig = {
196
+ excludeKeys: excludeKeys,
197
+ toolbarKeys: toolbarKeys,
198
+ insertKeys: insertKeys
199
+ }; // 编辑器配置
200
+
201
+ var editorConfig = {
202
+ placeholder: placeholder,
203
+ onFocus: onFocusCom,
204
+ onBlur: onBlurCom,
205
+ onDestroyed: onDestroyedCom,
206
+ readOnly: readOnly,
207
+ autoFocus: autoFocus,
208
+ maxLength: max,
209
+ MENU_CONF: {
210
+ uploadImage: Object.assign(Object.assign({}, uploadImage), {
211
+ server: server
212
+ }),
213
+ uploadVideo: Object.assign(Object.assign({}, uploadVideo), {
214
+ server: server
215
+ })
216
+ }
217
+ };
218
+ /** 改变事件 */
219
+
220
+ var onChangeCom = function onChangeCom(editor) {
221
+ if (props.value === undefined) setValueCom(editor.getHtml());
222
+ onChange && onChange(editor.getHtml(), editor.getText());
223
+ };
224
+ /**
225
+ * 处理class
226
+ * @return {string}
227
+ */
228
+
229
+
230
+ var handClass = function handClass() {
231
+ var str = $prefixCls + '-text-editor';
232
+ if (className) str += ' ' + className;
233
+ return str;
234
+ };
235
+ /** 标题 */
236
+
237
+
238
+ var labelMemo = useMemo(function () {
239
+ var handLabelClass = function handLabelClass() {
240
+ var str = 'text-editor-label';
241
+
242
+ if (labelTooltip && labelTooltip.className) {
243
+ str += ' ' + labelTooltip.className;
244
+ }
245
+
246
+ return str;
247
+ };
248
+
249
+ return jsx(Label, Object.assign({
250
+ label: label,
251
+ required: required,
252
+ labelSign: labelSign
253
+ }, labelTooltip, {
254
+ className: handLabelClass()
255
+ }));
256
+ }, [label, labelSign, required, labelTooltip]); // 工具栏
257
+
258
+ var toolbarMemo = useMemo(function () {
259
+ return jsx(Toolbar, {
260
+ editor: editor,
261
+ defaultConfig: toolbarConfig,
262
+ mode: "default",
263
+ style: toolbarStyle
264
+ });
265
+ }, [editor, toolbarConfig, toolbarStyle]); // 编辑器
266
+
267
+ var editorMemo = useMemo(function () {
268
+ return jsx(Editor, {
269
+ defaultConfig: editorConfig,
270
+ value: valueCom,
271
+ onCreated: setEditor,
272
+ onChange: onChangeCom,
273
+ mode: "default",
274
+ style: editorStyle
275
+ });
276
+ }, [editorConfig, valueCom, editorStyle, onChangeCom]);
277
+ return jsxs("div", Object.assign({
278
+ className: handClass(),
279
+ style: style
280
+ }, {
281
+ children: [labelMemo, jsxs("div", Object.assign({
282
+ className: 'text-editor-content'
283
+ }, {
284
+ children: [toolbarMemo, editorMemo]
285
+ })), jsx(HelperText, {
286
+ className: "text-editor-error-text",
287
+ error: error,
288
+ helperText: helperText,
289
+ hideErrorDom: hideErrorDom
290
+ })]
291
+ }));
292
+ });
293
+
294
+ export { TextEditor as default };
@@ -25,7 +25,7 @@ import '@para-ui/icons/LoadingF';
25
25
  import '@para-ui/core/GlobalContext';
26
26
  import 'rc-dropdown';
27
27
 
28
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-text-field {\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 display: inline-block;\n width: 100%;\n}\n.paraui-v3-text-field > .text-field-content {\n border: 1px solid;\n border-radius: 4px;\n border-color: rgba(171, 176, 185, 0.4);\n display: flex;\n width: 100%;\n position: relative;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-text-field > .text-field-content:hover {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-before {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-before svg {\n font-size: 20px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within {\n position: relative;\n display: flex;\n flex-grow: 1;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 16px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n color: rgba(46, 55, 67, 0.7);\n position: relative;\n z-index: 1;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon.right-icon-password:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 20px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .length-limit {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n width: 100%;\n line-height: 0;\n position: relative;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-outer-spin-button,\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input[type=number] {\n -moz-appearance: textfield;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n width: 100%;\n height: 100%;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n width: 100% !important;\n padding: 12px;\n resize: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n font-size: 14px;\n color: rgb(46, 55, 67);\n border: 0;\n border-radius: 4px;\n background: transparent;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input::-ms-clear, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea::-ms-clear {\n display: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input::-ms-reveal, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea::-ms-reveal {\n display: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input:disabled, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea:disabled {\n background-color: transparent;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n padding: 0 12px;\n color: rgba(46, 55, 67, 0.4);\n cursor: text;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder > .text-field-required {\n margin-left: 2px;\n color: rgb(235, 96, 84);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-after {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-left: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-after svg {\n font-size: 20px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .clean-up-icon {\n display: none;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n position: absolute;\n height: 22px;\n bottom: 0;\n border-radius: 4px;\n width: calc(100% - 12px);\n background: white;\n justify-content: flex-end;\n padding-bottom: 8px;\n margin-right: 0;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n padding-top: 12px;\n line-height: 1;\n height: calc(100% - 24px);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content:hover {\n border-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-before {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n cursor: not-allowed;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > input, .paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n cursor: not-allowed;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-after {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled.text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-error > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-error > .text-field-content:hover {\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit > .text-field-content:hover {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit-length > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n padding-bottom: 25px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-focus > .text-field-content {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content {\n height: 28px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-before {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 6px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content .text-field-content-after {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content {\n height: 32px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-before {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 8px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content .text-field-content-after {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content {\n height: 36px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-before {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 10px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content .text-field-content-after {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-resize > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n resize: both;\n}\n\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content {\n max-height: 300px;\n overflow: auto;\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item {\n display: flex;\n cursor: pointer;\n color: rgb(46, 55, 67);\n padding: 0 12px;\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item.text-field-select-content-item-keydown {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content.text-field-select-content-loading {\n height: 100px;\n position: relative;\n overflow: hidden;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-small > .text-field-select-content > .text-field-select-content-item {\n line-height: 28px;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-medium > .text-field-select-content > .text-field-select-content-item {\n line-height: 32px;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-large > .text-field-select-content > .text-field-select-content-item {\n line-height: 36px;\n}\n.paraui-v3-text-field-select.paraui-v3-text-field-select-data.component-tooltip {\n padding: 8px 0;\n}";
28
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-text-field {\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 display: inline-block;\n width: 100%;\n}\n.paraui-v3-text-field > .text-field-content {\n border: 1px solid;\n border-radius: 4px;\n border-color: rgba(171, 176, 185, 0.4);\n display: flex;\n width: 100%;\n position: relative;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-text-field > .text-field-content:hover {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-before {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-before svg {\n font-size: 20px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within {\n position: relative;\n display: flex;\n flex-grow: 1;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 16px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n color: rgba(46, 55, 67, 0.7);\n position: relative;\n z-index: 1;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon.right-icon-password:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 20px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .length-limit {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n width: 100%;\n line-height: 0;\n position: relative;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-outer-spin-button,\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input[type=number] {\n -moz-appearance: textfield;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n width: 100%;\n height: 100%;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n width: 100% !important;\n padding: 12px;\n resize: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n font-size: 14px;\n color: rgb(46, 55, 67);\n border: 0;\n border-radius: 4px;\n background: transparent;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input::-ms-clear, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea::-ms-clear {\n display: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input::-ms-reveal, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea::-ms-reveal {\n display: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input:disabled, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea:disabled {\n background-color: transparent;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n padding: 0 12px;\n color: rgba(46, 55, 67, 0.4);\n cursor: text;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder > .text-field-required {\n margin-left: 2px;\n color: rgb(235, 96, 84);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-after {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-left: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-after svg {\n font-size: 20px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .clean-up-icon {\n display: none;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n position: absolute;\n height: 22px;\n bottom: 0;\n border-radius: 4px;\n width: calc(100% - 12px);\n background: white;\n justify-content: flex-end;\n padding-bottom: 8px;\n margin-right: 0;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n padding-top: 12px;\n line-height: 1;\n height: calc(100% - 24px);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content:hover {\n border-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-before {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n cursor: not-allowed;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > input, .paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n cursor: not-allowed;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-after {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled.text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-error > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-error > .text-field-content:hover {\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit > .text-field-content:hover {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit-length > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n padding-bottom: 25px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-focus > .text-field-content {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content {\n height: 28px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-before {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 6px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content .text-field-content-after {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content {\n height: 32px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-before {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 8px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content .text-field-content-after {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content {\n height: 36px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-before {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 10px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content .text-field-content-after {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-resize > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n resize: both;\n}\n\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content {\n max-height: 300px;\n overflow: auto;\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item {\n display: flex;\n cursor: pointer;\n color: rgb(46, 55, 67);\n padding: 0 12px;\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item.text-field-select-content-item-keydown {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content.text-field-select-content-loading {\n height: 100px;\n position: relative;\n overflow: hidden;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-small > .text-field-select-content > .text-field-select-content-item {\n line-height: 28px;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-medium > .text-field-select-content > .text-field-select-content-item {\n line-height: 32px;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-large > .text-field-select-content > .text-field-select-content-item {\n line-height: 36px;\n}\n.paraui-v3-text-field-select.paraui-v3-text-field-select-data.component-tooltip {\n padding: 8px 0;\n}";
29
29
  styleInject(css_248z);
30
30
 
31
31
  var IsNaN = function IsNaN(value) {
package/Title/index.js CHANGED
@@ -3,7 +3,7 @@ import clsx from 'clsx';
3
3
  import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
4
4
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
5
5
 
6
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/8/11 2:55 PM\n* @description 标题\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-title {\n display: flex;\n align-items: center;\n line-height: 20px;\n}\n.paraui-v3-title .paraui-v3-title-ink {\n width: 4px;\n height: 14px;\n background-color: rgb(54, 102, 214);\n border-radius: 2px;\n}\n.paraui-v3-title .paraui-v3-title-icon {\n display: inline-flex;\n}\n.paraui-v3-title .paraui-v3-title-text {\n margin-left: 8px;\n font-size: 14px;\n font-weight: 700;\n color: rgb(28, 41, 60);\n}\n.paraui-v3-title .paraui-v3-title-subtext {\n margin-left: 12px;\n font-size: 14px;\n font-weight: 400;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-title .paraui-v3-title-link {\n margin-left: 12px;\n text-decoration: none;\n outline: none;\n font-size: 14px;\n font-weight: 400;\n color: rgb(54, 102, 214);\n}\n.paraui-v3-title.paraui-v3-title-large .paraui-v3-title-icon svg {\n font-size: 30px;\n}\n.paraui-v3-title.paraui-v3-title-large .paraui-v3-title-text {\n font-size: 18px;\n}\n.paraui-v3-title.paraui-v3-title-medium .paraui-v3-title-icon svg {\n font-size: 24px;\n}\n.paraui-v3-title.paraui-v3-title-medium .paraui-v3-title-text {\n font-size: 16px;\n}\n.paraui-v3-title.paraui-v3-title-small .paraui-v3-title-icon svg {\n font-size: 20px;\n}\n.paraui-v3-title.paraui-v3-title-small .paraui-v3-title-text {\n margin-left: 4px;\n}";
6
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/8/11 2:55 PM\n* @description 标题\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-title {\n display: flex;\n align-items: center;\n line-height: 20px;\n}\n.paraui-v3-title .title-ink {\n width: 4px;\n height: 14px;\n background-color: rgb(54, 102, 214);\n border-radius: 2px;\n}\n.paraui-v3-title .title-icon {\n display: inline-flex;\n}\n.paraui-v3-title .title-text {\n margin-left: 8px;\n font-size: 14px;\n font-weight: 700;\n color: rgb(28, 41, 60);\n}\n.paraui-v3-title .title-subtext {\n margin-left: 12px;\n font-size: 14px;\n font-weight: 400;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-title .title-link {\n margin-left: 12px;\n text-decoration: none;\n outline: none;\n font-size: 14px;\n font-weight: 400;\n color: rgb(54, 102, 214);\n}\n.paraui-v3-title.paraui-v3-title-large .title-icon svg {\n font-size: 30px;\n}\n.paraui-v3-title.paraui-v3-title-large .title-text {\n font-size: 18px;\n}\n.paraui-v3-title.paraui-v3-title-medium .title-icon svg {\n font-size: 24px;\n}\n.paraui-v3-title.paraui-v3-title-medium .title-text {\n font-size: 16px;\n}\n.paraui-v3-title.paraui-v3-title-small .title-icon svg {\n font-size: 20px;\n}\n.paraui-v3-title.paraui-v3-title-small .title-text {\n margin-left: 4px;\n}";
7
7
  styleInject(css_248z);
8
8
 
9
9
  var Title = function Title(props) {
@@ -22,21 +22,21 @@ var Title = function Title(props) {
22
22
  style: style
23
23
  }, {
24
24
  children: [icon ? jsx("span", Object.assign({
25
- className: "".concat($prefixCls, "-title-icon")
25
+ className: "title-icon"
26
26
  }, {
27
27
  children: icon
28
28
  })) : jsx("span", {
29
- className: "".concat($prefixCls, "-title-ink")
29
+ className: "title-ink"
30
30
  }), jsx("span", Object.assign({
31
- className: "".concat($prefixCls, "-title-text")
31
+ className: "title-text"
32
32
  }, {
33
33
  children: title
34
34
  })), subTitle && jsx("span", Object.assign({
35
- className: "".concat($prefixCls, "-title-subtext")
35
+ className: "title-subtext"
36
36
  }, {
37
37
  children: subTitle
38
38
  })), link && jsx("a", Object.assign({
39
- className: "".concat($prefixCls, "-title-link"),
39
+ className: "title-link",
40
40
  target: link.target || '_blank',
41
41
  href: link.href,
42
42
  onClick: link.onClick
@@ -0,0 +1,19 @@
1
+ function getTransitionProps(props, options) {
2
+ var timeout = props.timeout,
3
+ _props$style = props.style,
4
+ style = _props$style === void 0 ? {} : _props$style;
5
+ return {
6
+ duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
7
+ delay: style.transitionDelay
8
+ };
9
+ }
10
+ function getAutoHeightDuration(height) {
11
+ if (!height) {
12
+ return 0;
13
+ }
14
+
15
+ var constant = height / 36;
16
+ return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
17
+ }
18
+
19
+ export { getAutoHeightDuration as a, getTransitionProps as g };
package/index.d.ts CHANGED
@@ -20,6 +20,8 @@ export { default as Collapse } from './Collapse';
20
20
  export * from './Collapse';
21
21
  export { default as CollapseBox } from './CollapseBox';
22
22
  export * from './CollapseBox';
23
+ export { default as CollapseLayout } from './CollapseLayout';
24
+ export * from './CollapseLayout';
23
25
  export { default as ColorPicker } from './ColorPicker';
24
26
  export * from './ColorPicker';
25
27
  export { default as ComboSelect } from './ComboSelect';
@@ -114,6 +116,8 @@ export { default as Tag } from './Tag';
114
116
  export * from './Tag';
115
117
  export { default as Test } from './Test';
116
118
  export * from './Test';
119
+ export { default as TextEditor } from './TextEditor';
120
+ export * from './TextEditor';
117
121
  export { default as TextField } from './TextField';
118
122
  export * from './TextField';
119
123
  export { default as TimePicker } from './TimePicker';
package/index.js CHANGED
@@ -9,6 +9,7 @@ export { Checkbox } from './Checkbox/index.js';
9
9
  export { CheckboxGroup } from './CheckboxGroup/index.js';
10
10
  export { Collapse } from './Collapse/index.js';
11
11
  export { default as CollapseBox } from './CollapseBox/index.js';
12
+ export { default as CollapseLayout } from './CollapseLayout/index.js';
12
13
  export { ChromePicker, SketchPicker as ColorPicker, CompactPicker, SwatchesPicker } from 'react-color';
13
14
  import './_verture/index-a369ca3f.js';
14
15
  export { ComboSelect } from './ComboSelect/index.js';
@@ -19,7 +20,7 @@ export { Drawer } from './Drawer/index.js';
19
20
  export { Dropdown } from './Dropdown/index.js';
20
21
  export { default as Empty } from './Empty/index.js';
21
22
  export { default as Form } from './Form/index.js';
22
- export { F as FormItem } from './_verture/index-4b4ee8b5.js';
23
+ export { F as FormItem } from './_verture/index-7b63f88e.js';
23
24
  export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-4bce2dae.js';
24
25
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
25
26
  export { default as Help } from './Help/index.js';
@@ -57,6 +58,7 @@ export { default as Table } from './Table/index.js';
57
58
  export { Tabs } from './Tabs/index.js';
58
59
  export { Tag, TagGroup } from './Tag/index.js';
59
60
  export { Test } from './Test/index.js';
61
+ export { default as TextEditor } from './TextEditor/index.js';
60
62
  export { TextField } from './TextField/index.js';
61
63
  export { default as TimePicker } from './TimePicker/index.js';
62
64
  export { Timeline } from './Timeline/index.js';
@@ -92,6 +94,9 @@ import '@para-ui/icons/Right';
92
94
  import '@para-ui/icons/Loading';
93
95
  import 'rc-collapse';
94
96
  import 'react-transition-group';
97
+ import './_verture/util-a77b261e.js';
98
+ import '@para-ui/icons/DoubleLeft';
99
+ import '@para-ui/icons/DoubleRight';
95
100
  import '@para-ui/icons/Search';
96
101
  import '@para-ui/icons/Close';
97
102
  import '@para-ui/icons/CloseCircle';
@@ -126,8 +131,6 @@ import 'rc-dialog';
126
131
  import '@para-ui/icons/WarningCircle';
127
132
  import 'rc-notification';
128
133
  import 'rc-pagination';
129
- import '@para-ui/icons/DoubleLeft';
130
- import '@para-ui/icons/DoubleRight';
131
134
  import '@para-ui/icons/Left';
132
135
  import 'rc-progress';
133
136
  import '@para-ui/icons/Check';
@@ -149,6 +152,7 @@ import '@para-ui/icons/UpTriangleF';
149
152
  import '@para-ui/icons/DownTriangleF';
150
153
  import '@para-ui/icons/Panel';
151
154
  import 'rc-tabs';
155
+ import '@wangeditor/editor-for-react';
152
156
  import '@para-ui/icons/PreviewClose';
153
157
  import '@para-ui/icons/PreviewOpen';
154
158
  import 'rc-tooltip';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@para-ui/core",
3
3
  "private": false,
4
- "version": "3.0.4",
4
+ "version": "3.0.7",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",
@@ -18,6 +18,8 @@
18
18
  "@para-ui/core": "^3.0.0",
19
19
  "@para-ui/icons": "^3.0.0",
20
20
  "@paraview/lib": "^2.0.3",
21
+ "@wangeditor/editor": "^5.1.15",
22
+ "@wangeditor/editor-for-react": "^1.0.5",
21
23
  "clsx": "1.1.1",
22
24
  "dayjs": "^1.11.3",
23
25
  "rc-cascader": "2.1.2",