Browse Source

dev: [BarftEditorPage]add props placeholder

Roxas 4 years ago
parent
commit
536bf25b2d

+ 1
- 1
eslib/AllocWantedModal/index.d.ts View File

22
     ModalInputRef: RefObject<Input>;
22
     ModalInputRef: RefObject<Input>;
23
     ModalContentRef: RefObject<any>;
23
     ModalContentRef: RefObject<any>;
24
     constructor(props: AllocWantedModalProps);
24
     constructor(props: AllocWantedModalProps);
25
-    handleSendValueChange: (v: string | number) => void;
25
+    handleSendValueChange: (v: React.ReactText) => void;
26
     checkSendValue: () => boolean;
26
     checkSendValue: () => boolean;
27
     handleCloseAction: () => void;
27
     handleCloseAction: () => void;
28
     handleShowAction: () => void;
28
     handleShowAction: () => void;

+ 5
- 1
eslib/BraftEditor/index.d.ts View File

7
     contentStyle?: React.CSSProperties;
7
     contentStyle?: React.CSSProperties;
8
     controls?: ControlType[];
8
     controls?: ControlType[];
9
     FloatControls?: any;
9
     FloatControls?: any;
10
+    blockRenderMap?: any;
11
+    blockRendererFn?: any;
12
+    placeholder?: string;
13
+    converts?: any;
10
 }
14
 }
11
-declare const BarftEditorPage: ({ value, onChange, controls, contentStyle, FloatControls }: BaseEditorProps) => JSX.Element;
15
+declare const BarftEditorPage: ({ value, onChange, controls, contentStyle, FloatControls, placeholder, blockRenderMap, blockRendererFn, converts, }: BaseEditorProps) => JSX.Element;
12
 export { BarftEditorPage as default, BarftEditorPage, BaseEditorProps };
16
 export { BarftEditorPage as default, BarftEditorPage, BaseEditorProps };

+ 12
- 3
eslib/BraftEditor/index.js View File

40
       controls = _ref.controls,
40
       controls = _ref.controls,
41
       _ref$contentStyle = _ref.contentStyle,
41
       _ref$contentStyle = _ref.contentStyle,
42
       contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,
42
       contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,
43
-      FloatControls = _ref.FloatControls;
43
+      FloatControls = _ref.FloatControls,
44
+      placeholder = _ref.placeholder,
45
+      blockRenderMap = _ref.blockRenderMap,
46
+      blockRendererFn = _ref.blockRendererFn,
47
+      converts = _ref.converts;
44
   var optionsControls = controls ? controls : ["bold", "italic", "underline", "separator", "link", "emoji", "separator", "media"];
48
   var optionsControls = controls ? controls : ["bold", "italic", "underline", "separator", "link", "emoji", "separator", "media"];
45
   var options = {
49
   var options = {
46
     controls: optionsControls,
50
     controls: optionsControls,
55
 
59
 
56
   return React.createElement("div", {
60
   return React.createElement("div", {
57
     className: styles.baseWrapper
61
     className: styles.baseWrapper
58
-  }, React.createElement(BraftEditor, {
62
+  }, React.createElement(BraftEditor, Object.assign({
59
     value: value,
63
     value: value,
60
     onChange: onChange,
64
     onChange: onChange,
61
     controls: options.controls,
65
     controls: options.controls,
82
         };
86
         };
83
       }
87
       }
84
     }
88
     }
85
-  }), options.showFloatControls ? React.createElement("div", {
89
+  }, {
90
+    blockRenderMap: blockRenderMap,
91
+    blockRendererFn: blockRendererFn,
92
+    converts: converts,
93
+    placeholder: placeholder
94
+  })), options.showFloatControls ? React.createElement("div", {
86
     className: classnames(styles.floatControls)
95
     className: classnames(styles.floatControls)
87
   }, React.createElement(FloatControls, {
96
   }, React.createElement(FloatControls, {
88
     editorState: value,
97
     editorState: value,

+ 1
- 1
eslib/BraftEditor/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/AllocWantedModal/index.d.ts View File

22
     ModalInputRef: RefObject<Input>;
22
     ModalInputRef: RefObject<Input>;
23
     ModalContentRef: RefObject<any>;
23
     ModalContentRef: RefObject<any>;
24
     constructor(props: AllocWantedModalProps);
24
     constructor(props: AllocWantedModalProps);
25
-    handleSendValueChange: (v: string | number) => void;
25
+    handleSendValueChange: (v: React.ReactText) => void;
26
     checkSendValue: () => boolean;
26
     checkSendValue: () => boolean;
27
     handleCloseAction: () => void;
27
     handleCloseAction: () => void;
28
     handleShowAction: () => void;
28
     handleShowAction: () => void;

+ 5
- 1
lib/BraftEditor/index.d.ts View File

7
     contentStyle?: React.CSSProperties;
7
     contentStyle?: React.CSSProperties;
8
     controls?: ControlType[];
8
     controls?: ControlType[];
9
     FloatControls?: any;
9
     FloatControls?: any;
10
+    blockRenderMap?: any;
11
+    blockRendererFn?: any;
12
+    placeholder?: string;
13
+    converts?: any;
10
 }
14
 }
11
-declare const BarftEditorPage: ({ value, onChange, controls, contentStyle, FloatControls }: BaseEditorProps) => JSX.Element;
15
+declare const BarftEditorPage: ({ value, onChange, controls, contentStyle, FloatControls, placeholder, blockRenderMap, blockRendererFn, converts, }: BaseEditorProps) => JSX.Element;
12
 export { BarftEditorPage as default, BarftEditorPage, BaseEditorProps };
16
 export { BarftEditorPage as default, BarftEditorPage, BaseEditorProps };

+ 12
- 3
lib/BraftEditor/index.js View File

48
       controls = _ref.controls,
48
       controls = _ref.controls,
49
       _ref$contentStyle = _ref.contentStyle,
49
       _ref$contentStyle = _ref.contentStyle,
50
       contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,
50
       contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,
51
-      FloatControls = _ref.FloatControls;
51
+      FloatControls = _ref.FloatControls,
52
+      placeholder = _ref.placeholder,
53
+      blockRenderMap = _ref.blockRenderMap,
54
+      blockRendererFn = _ref.blockRendererFn,
55
+      converts = _ref.converts;
52
   var optionsControls = controls ? controls : ["bold", "italic", "underline", "separator", "link", "emoji", "separator", "media"];
56
   var optionsControls = controls ? controls : ["bold", "italic", "underline", "separator", "link", "emoji", "separator", "media"];
53
   var options = {
57
   var options = {
54
     controls: optionsControls,
58
     controls: optionsControls,
63
 
67
 
64
   return React__default.createElement("div", {
68
   return React__default.createElement("div", {
65
     className: styles.baseWrapper
69
     className: styles.baseWrapper
66
-  }, React__default.createElement(BraftEditor, {
70
+  }, React__default.createElement(BraftEditor, Object.assign({
67
     value: value,
71
     value: value,
68
     onChange: onChange,
72
     onChange: onChange,
69
     controls: options.controls,
73
     controls: options.controls,
90
         };
94
         };
91
       }
95
       }
92
     }
96
     }
93
-  }), options.showFloatControls ? React__default.createElement("div", {
97
+  }, {
98
+    blockRenderMap: blockRenderMap,
99
+    blockRendererFn: blockRendererFn,
100
+    converts: converts,
101
+    placeholder: placeholder
102
+  })), options.showFloatControls ? React__default.createElement("div", {
94
     className: index.classnames(styles.floatControls)
103
     className: index.classnames(styles.floatControls)
95
   }, React__default.createElement(FloatControls, {
104
   }, React__default.createElement(FloatControls, {
96
     editorState: value,
105
     editorState: value,

+ 1
- 1
lib/BraftEditor/index.js.map
File diff suppressed because it is too large
View File


+ 16
- 1
src/components/Editor/BraftEditor/index.tsx View File

42
   contentStyle?: React.CSSProperties;
42
   contentStyle?: React.CSSProperties;
43
   controls?: ControlType[];
43
   controls?: ControlType[];
44
   FloatControls?: any;
44
   FloatControls?: any;
45
+  
46
+  blockRenderMap?: any;
47
+  blockRendererFn?: any;
48
+  placeholder?: string;
49
+  converts?: any;
45
 }
50
 }
46
 
51
 
47
 export const BarftEditorPage = ({
52
 export const BarftEditorPage = ({
49
   onChange,
54
   onChange,
50
   controls,
55
   controls,
51
   contentStyle = {},
56
   contentStyle = {},
52
-  FloatControls
57
+  FloatControls,
58
+  placeholder,
59
+  blockRenderMap,
60
+  blockRendererFn,
61
+  converts,
53
 }: BaseEditorProps) => {
62
 }: BaseEditorProps) => {
54
   const optionsControls = controls
63
   const optionsControls = controls
55
     ? controls
64
     ? controls
95
             return { href, target };
104
             return { href, target };
96
           }
105
           }
97
         }}
106
         }}
107
+        {...{
108
+          blockRenderMap,
109
+          blockRendererFn,
110
+          converts,
111
+          placeholder,
112
+        }}
98
       />
113
       />
99
       {options.showFloatControls ? (
114
       {options.showFloatControls ? (
100
         <div className={classnames(styles.floatControls)}>
115
         <div className={classnames(styles.floatControls)}>

+ 2
- 1
stats.html
File diff suppressed because it is too large
View File