@para-ui/core 3.0.5 → 3.0.6

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/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-9d9fefc1.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-9d9fefc1.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/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 版本: 3.0.6
2
+
3
+ para-ui/core@3.0.6 发布
4
+ 【TextEditor】新增富文本编辑器
5
+
1
6
  ## 版本: 3.0.5
2
7
 
3
8
  para-ui/core@3.0.5 发布
@@ -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;