Browse Source

dev: [BarftEditorPage]add props placeholder

Roxas 4 years ago
parent
commit
536bf25b2d

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

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

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

@@ -7,6 +7,10 @@ interface BaseEditorProps {
7 7
     contentStyle?: React.CSSProperties;
8 8
     controls?: ControlType[];
9 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 16
 export { BarftEditorPage as default, BarftEditorPage, BaseEditorProps };

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

@@ -40,7 +40,11 @@ var BarftEditorPage = function BarftEditorPage(_ref) {
40 40
       controls = _ref.controls,
41 41
       _ref$contentStyle = _ref.contentStyle,
42 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 48
   var optionsControls = controls ? controls : ["bold", "italic", "underline", "separator", "link", "emoji", "separator", "media"];
45 49
   var options = {
46 50
     controls: optionsControls,
@@ -55,7 +59,7 @@ var BarftEditorPage = function BarftEditorPage(_ref) {
55 59
 
56 60
   return React.createElement("div", {
57 61
     className: styles.baseWrapper
58
-  }, React.createElement(BraftEditor, {
62
+  }, React.createElement(BraftEditor, Object.assign({
59 63
     value: value,
60 64
     onChange: onChange,
61 65
     controls: options.controls,
@@ -82,7 +86,12 @@ var BarftEditorPage = function BarftEditorPage(_ref) {
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 95
     className: classnames(styles.floatControls)
87 96
   }, React.createElement(FloatControls, {
88 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,7 +22,7 @@ declare class AllocWantedModal extends React.Component<AllocWantedModalProps, Al
22 22
     ModalInputRef: RefObject<Input>;
23 23
     ModalContentRef: RefObject<any>;
24 24
     constructor(props: AllocWantedModalProps);
25
-    handleSendValueChange: (v: string | number) => void;
25
+    handleSendValueChange: (v: React.ReactText) => void;
26 26
     checkSendValue: () => boolean;
27 27
     handleCloseAction: () => void;
28 28
     handleShowAction: () => void;

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

@@ -7,6 +7,10 @@ interface BaseEditorProps {
7 7
     contentStyle?: React.CSSProperties;
8 8
     controls?: ControlType[];
9 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 16
 export { BarftEditorPage as default, BarftEditorPage, BaseEditorProps };

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

@@ -48,7 +48,11 @@ var BarftEditorPage = function BarftEditorPage(_ref) {
48 48
       controls = _ref.controls,
49 49
       _ref$contentStyle = _ref.contentStyle,
50 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 56
   var optionsControls = controls ? controls : ["bold", "italic", "underline", "separator", "link", "emoji", "separator", "media"];
53 57
   var options = {
54 58
     controls: optionsControls,
@@ -63,7 +67,7 @@ var BarftEditorPage = function BarftEditorPage(_ref) {
63 67
 
64 68
   return React__default.createElement("div", {
65 69
     className: styles.baseWrapper
66
-  }, React__default.createElement(BraftEditor, {
70
+  }, React__default.createElement(BraftEditor, Object.assign({
67 71
     value: value,
68 72
     onChange: onChange,
69 73
     controls: options.controls,
@@ -90,7 +94,12 @@ var BarftEditorPage = function BarftEditorPage(_ref) {
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 103
     className: index.classnames(styles.floatControls)
95 104
   }, React__default.createElement(FloatControls, {
96 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,6 +42,11 @@ export interface BaseEditorProps {
42 42
   contentStyle?: React.CSSProperties;
43 43
   controls?: ControlType[];
44 44
   FloatControls?: any;
45
+  
46
+  blockRenderMap?: any;
47
+  blockRendererFn?: any;
48
+  placeholder?: string;
49
+  converts?: any;
45 50
 }
46 51
 
47 52
 export const BarftEditorPage = ({
@@ -49,7 +54,11 @@ export const BarftEditorPage = ({
49 54
   onChange,
50 55
   controls,
51 56
   contentStyle = {},
52
-  FloatControls
57
+  FloatControls,
58
+  placeholder,
59
+  blockRenderMap,
60
+  blockRendererFn,
61
+  converts,
53 62
 }: BaseEditorProps) => {
54 63
   const optionsControls = controls
55 64
     ? controls
@@ -95,6 +104,12 @@ export const BarftEditorPage = ({
95 104
             return { href, target };
96 105
           }
97 106
         }}
107
+        {...{
108
+          blockRenderMap,
109
+          blockRendererFn,
110
+          converts,
111
+          placeholder,
112
+        }}
98 113
       />
99 114
       {options.showFloatControls ? (
100 115
         <div className={classnames(styles.floatControls)}>

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