amis 1.9.1-beta.21 → 1.9.1-beta.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. package/lib/components/AssociatedSelection.d.ts +40 -40
  2. package/lib/components/Badge.d.ts +1 -1
  3. package/lib/components/Badge.js.map +1 -1
  4. package/lib/components/ChainedSelection.d.ts +40 -40
  5. package/lib/components/GroupedSelection.d.ts +40 -40
  6. package/lib/components/GroupedSelection.js +2 -3
  7. package/lib/components/GroupedSelection.js.map +2 -2
  8. package/lib/components/PickerContainer.d.ts +0 -1
  9. package/lib/components/PickerContainer.js +4 -4
  10. package/lib/components/PickerContainer.js.map +2 -2
  11. package/lib/components/ResultBox.js +3 -1
  12. package/lib/components/ResultBox.js.map +2 -2
  13. package/lib/components/ResultList.d.ts +53 -43
  14. package/lib/components/ResultList.js +22 -34
  15. package/lib/components/ResultList.js.map +2 -2
  16. package/lib/components/ResultTableList.d.ts +40 -40
  17. package/lib/components/ResultTreeList.d.ts +40 -40
  18. package/lib/components/Select.js +10 -6
  19. package/lib/components/Select.js.map +2 -2
  20. package/lib/components/Selection.d.ts +40 -41
  21. package/lib/components/Selection.js.map +2 -2
  22. package/lib/components/TableSelection.d.ts +40 -40
  23. package/lib/components/TabsTransfer.d.ts +2 -2
  24. package/lib/components/TabsTransfer.js.map +1 -1
  25. package/lib/components/Transfer.d.ts +40 -40
  26. package/lib/components/Transfer.js +1 -1
  27. package/lib/components/Transfer.js.map +2 -2
  28. package/lib/components/TransferDropDown.d.ts +40 -40
  29. package/lib/components/TreeSelection.d.ts +40 -40
  30. package/lib/components/TreeSelection.js +2 -3
  31. package/lib/components/TreeSelection.js.map +2 -2
  32. package/lib/components/formula/Editor.d.ts +45 -45
  33. package/lib/components/formula/Editor.js +16 -11
  34. package/lib/components/formula/Editor.js.map +2 -2
  35. package/lib/components/formula/Picker.d.ts +85 -40
  36. package/lib/components/formula/Picker.js +12 -6
  37. package/lib/components/formula/Picker.js.map +2 -2
  38. package/lib/components/formula/VariableList.d.ts +0 -2
  39. package/lib/components/formula/VariableList.js +5 -15
  40. package/lib/components/formula/VariableList.js.map +2 -2
  41. package/lib/components/index.d.ts +1 -3
  42. package/lib/components/index.js +1 -5
  43. package/lib/components/index.js.map +2 -2
  44. package/lib/components/schema-editor/SchemaVariableList.d.ts +0 -1
  45. package/lib/components/schema-editor/SchemaVariableList.js +2 -2
  46. package/lib/components/schema-editor/SchemaVariableList.js.map +2 -2
  47. package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +0 -1
  48. package/lib/components/schema-editor/SchemaVariableListPicker.js +2 -2
  49. package/lib/components/schema-editor/SchemaVariableListPicker.js.map +2 -2
  50. package/lib/helper.css.map +1 -1
  51. package/lib/index.js +1 -1
  52. package/lib/renderers/CRUD.js +3 -3
  53. package/lib/renderers/CRUD.js.map +2 -2
  54. package/lib/renderers/Form/DiffEditor.d.ts +66 -20
  55. package/lib/renderers/Form/Editor.d.ts +66 -20
  56. package/lib/renderers/Form/Group.js +1 -1
  57. package/lib/renderers/Form/Group.js.map +2 -2
  58. package/lib/renderers/Form/InputFormula.d.ts +5 -5
  59. package/lib/renderers/Form/InputFormula.js +4 -3
  60. package/lib/renderers/Form/InputFormula.js.map +2 -2
  61. package/lib/renderers/Form/InputTag.d.ts +1 -1
  62. package/lib/renderers/Form/InputTag.js.map +1 -1
  63. package/lib/renderers/Form/Options.js +7 -7
  64. package/lib/renderers/Form/Options.js.map +2 -2
  65. package/lib/renderers/Form/Select.d.ts +6 -1
  66. package/lib/renderers/Form/Select.js +3 -1
  67. package/lib/renderers/Form/Select.js.map +2 -2
  68. package/lib/renderers/Form/TreeSelect.d.ts +0 -1
  69. package/lib/renderers/Form/TreeSelect.js +1 -9
  70. package/lib/renderers/Form/TreeSelect.js.map +2 -2
  71. package/lib/renderers/Form/index.js +9 -4
  72. package/lib/renderers/Form/index.js.map +2 -2
  73. package/lib/renderers/Table/exportExcel.js +1 -1
  74. package/lib/renderers/Table/exportExcel.js.map +2 -2
  75. package/lib/renderers/Table/index.d.ts +2 -0
  76. package/lib/renderers/Table/index.js +37 -5
  77. package/lib/renderers/Table/index.js.map +2 -2
  78. package/lib/renderers/Tpl.d.ts +4 -0
  79. package/lib/renderers/Tpl.js +6 -3
  80. package/lib/renderers/Tpl.js.map +2 -2
  81. package/lib/store/combo.d.ts +72 -22
  82. package/lib/store/form.d.ts +30 -9
  83. package/lib/store/form.js +28 -10
  84. package/lib/store/form.js.map +2 -2
  85. package/lib/store/formItem.d.ts +3 -1
  86. package/lib/store/formItem.js +3 -5
  87. package/lib/store/formItem.js.map +2 -2
  88. package/lib/store/table.d.ts +60 -18
  89. package/lib/themes/ang-ie11.css +33 -9
  90. package/lib/themes/ang.css +27 -9
  91. package/lib/themes/ang.css.map +1 -1
  92. package/lib/themes/antd-ie11.css +33 -9
  93. package/lib/themes/antd.css +27 -9
  94. package/lib/themes/antd.css.map +1 -1
  95. package/lib/themes/cxd-ie11.css +35 -15
  96. package/lib/themes/cxd.css +31 -17
  97. package/lib/themes/cxd.css.map +1 -1
  98. package/lib/themes/dark-ie11.css +33 -9
  99. package/lib/themes/dark.css +27 -9
  100. package/lib/themes/dark.css.map +1 -1
  101. package/lib/themes/default-ie11.css +35 -15
  102. package/lib/themes/default.css +31 -17
  103. package/lib/themes/default.css.map +1 -1
  104. package/lib/utils/formula.js +2 -3
  105. package/lib/utils/formula.js.map +2 -2
  106. package/lib/utils/helper.js +1 -1
  107. package/lib/utils/helper.js.map +2 -2
  108. package/package.json +1 -1
  109. package/schema.json +22 -16
  110. package/scss/_mixins.scss +1 -1
  111. package/scss/components/form/_date.scss +9 -10
  112. package/scss/components/form/_select.scss +14 -0
  113. package/scss/components/form/_transfer.scss +1 -2
  114. package/scss/themes/cxd.scss +4 -9
  115. package/sdk/ang-ie11.css +36 -9
  116. package/sdk/ang.css +30 -9
  117. package/sdk/antd-ie11.css +36 -9
  118. package/sdk/antd.css +30 -9
  119. package/sdk/barcode.js +51 -51
  120. package/sdk/charts.js +14 -14
  121. package/sdk/codemirror.js +7 -7
  122. package/sdk/color-picker.js +65 -65
  123. package/sdk/cropperjs.js +2 -2
  124. package/sdk/cxd-ie11.css +38 -16
  125. package/sdk/cxd.css +34 -18
  126. package/sdk/dark-ie11.css +36 -9
  127. package/sdk/dark.css +30 -9
  128. package/sdk/exceljs.js +1 -1
  129. package/sdk/helper.css.map +1 -1
  130. package/sdk/markdown.js +69 -69
  131. package/sdk/papaparse.js +1 -1
  132. package/sdk/renderers/Form/CityDB.js +1 -1
  133. package/sdk/rest.js +16 -16
  134. package/sdk/rich-text.js +62 -62
  135. package/sdk/sdk-ie11.css +38 -16
  136. package/sdk/sdk.css +34 -18
  137. package/sdk/sdk.js +1356 -1354
  138. package/sdk/thirds/hls.js/hls.js +1 -1
  139. package/sdk/thirds/mpegts.js/mpegts.js +1 -1
  140. package/sdk/tinymce.js +57 -57
  141. package/src/components/Badge.tsx +1 -1
  142. package/src/components/GroupedSelection.tsx +2 -3
  143. package/src/components/PickerContainer.tsx +8 -13
  144. package/src/components/ResultBox.tsx +3 -1
  145. package/src/components/ResultList.tsx +51 -48
  146. package/src/components/Select.tsx +16 -8
  147. package/src/components/Selection.tsx +0 -1
  148. package/src/components/TabsTransfer.tsx +2 -2
  149. package/src/components/Transfer.tsx +4 -0
  150. package/src/components/TreeSelection.tsx +1 -2
  151. package/src/components/formula/Editor.tsx +51 -38
  152. package/src/components/formula/Picker.tsx +26 -7
  153. package/src/components/formula/VariableList.tsx +2 -36
  154. package/src/components/index.tsx +0 -4
  155. package/src/components/schema-editor/SchemaVariableList.tsx +2 -4
  156. package/src/components/schema-editor/SchemaVariableListPicker.tsx +1 -4
  157. package/src/renderers/CRUD.tsx +3 -3
  158. package/src/renderers/Form/Group.tsx +1 -1
  159. package/src/renderers/Form/InputFormula.tsx +11 -10
  160. package/src/renderers/Form/InputTag.tsx +1 -1
  161. package/src/renderers/Form/Options.tsx +7 -9
  162. package/src/renderers/Form/Select.tsx +10 -2
  163. package/src/renderers/Form/TreeSelect.tsx +14 -16
  164. package/src/renderers/Form/index.tsx +13 -2
  165. package/src/renderers/Table/exportExcel.ts +1 -1
  166. package/src/renderers/Table/index.tsx +42 -6
  167. package/src/renderers/Tpl.tsx +11 -1
  168. package/src/store/form.ts +31 -24
  169. package/src/store/formItem.ts +65 -52
  170. package/src/utils/formula.ts +2 -2
  171. package/src/utils/helper.ts +2 -2
@@ -11,7 +11,7 @@ export interface VariableItem {
11
11
  label: string;
12
12
  value?: string;
13
13
  children?: Array<VariableItem>;
14
- type?: string;
14
+ type: '';
15
15
  tag?: string;
16
16
  selectMode?: 'tree' | 'tabs';
17
17
  }
@@ -42,6 +42,10 @@ export interface FormulaEditorProps extends ThemeProps, LocaleProps {
42
42
  * 变量展现模式,可选值:'tabs' | 'tree'
43
43
  */
44
44
  variableMode?: 'tabs' | 'tree';
45
+ /**
46
+ * 只展示变量,不需要其他面板
47
+ */
48
+ onlyVariable?: boolean;
45
49
  /**
46
50
  * 函数集合,默认不需要传,即 amis-formula 里面那个函数
47
51
  * 如果有扩充,则需要传。
@@ -53,10 +57,6 @@ export interface FormulaEditorProps extends ThemeProps, LocaleProps {
53
57
  header: string;
54
58
  variableClassName?: string;
55
59
  functionClassName?: string;
56
- /**
57
- * 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染
58
- */
59
- selfVariableName?: string;
60
60
  }
61
61
  export interface FunctionsProps {
62
62
  name: string;
@@ -96,7 +96,7 @@ export declare class FormulaEditor extends React.Component<FormulaEditorProps, F
96
96
  render(): JSX.Element;
97
97
  }
98
98
  declare const _default: {
99
- new (props: Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
99
+ new (props: Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
100
100
  locale?: string | undefined;
101
101
  translate?: ((str: string, ...args: any[]) => string) | undefined;
102
102
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps): {
@@ -105,12 +105,12 @@ declare const _default: {
105
105
  getWrappedInstance(): any;
106
106
  render(): JSX.Element;
107
107
  context: any;
108
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
108
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
109
109
  locale?: string | undefined;
110
110
  translate?: ((str: string, ...args: any[]) => string) | undefined;
111
111
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
112
112
  forceUpdate(callback?: (() => void) | undefined): void;
113
- readonly props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
113
+ readonly props: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
114
114
  locale?: string | undefined;
115
115
  translate?: ((str: string, ...args: any[]) => string) | undefined;
116
116
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps> & Readonly<{
@@ -121,35 +121,35 @@ declare const _default: {
121
121
  [key: string]: React.ReactInstance;
122
122
  };
123
123
  componentDidMount?(): void;
124
- shouldComponentUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
124
+ shouldComponentUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
125
125
  locale?: string | undefined;
126
126
  translate?: ((str: string, ...args: any[]) => string) | undefined;
127
127
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
128
128
  componentWillUnmount?(): void;
129
129
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
130
- getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
130
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
131
131
  locale?: string | undefined;
132
132
  translate?: ((str: string, ...args: any[]) => string) | undefined;
133
133
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
134
- componentDidUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
134
+ componentDidUpdate?(prevProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
135
135
  locale?: string | undefined;
136
136
  translate?: ((str: string, ...args: any[]) => string) | undefined;
137
137
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
138
138
  componentWillMount?(): void;
139
139
  UNSAFE_componentWillMount?(): void;
140
- componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
140
+ componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
141
141
  locale?: string | undefined;
142
142
  translate?: ((str: string, ...args: any[]) => string) | undefined;
143
143
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
144
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
144
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
145
145
  locale?: string | undefined;
146
146
  translate?: ((str: string, ...args: any[]) => string) | undefined;
147
147
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextContext: any): void;
148
- componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
148
+ componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
149
149
  locale?: string | undefined;
150
150
  translate?: ((str: string, ...args: any[]) => string) | undefined;
151
151
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
152
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
152
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
153
153
  locale?: string | undefined;
154
154
  translate?: ((str: string, ...args: any[]) => string) | undefined;
155
155
  }, keyof ThemeProps> & import("../../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
@@ -157,7 +157,7 @@ declare const _default: {
157
157
  displayName: string;
158
158
  contextType: React.Context<string>;
159
159
  ComposedComponent: React.ComponentType<{
160
- new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
160
+ new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
161
161
  locale?: string | undefined;
162
162
  translate?: ((str: string, ...args: any[]) => string) | undefined;
163
163
  }): {
@@ -166,12 +166,12 @@ declare const _default: {
166
166
  getWrappedInstance(): any;
167
167
  render(): JSX.Element;
168
168
  context: any;
169
- setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
169
+ setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
170
170
  locale?: string | undefined;
171
171
  translate?: ((str: string, ...args: any[]) => string) | undefined;
172
172
  }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
173
173
  forceUpdate(callback?: (() => void) | undefined): void;
174
- readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
174
+ readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
175
175
  locale?: string | undefined;
176
176
  translate?: ((str: string, ...args: any[]) => string) | undefined;
177
177
  }> & Readonly<{
@@ -182,35 +182,35 @@ declare const _default: {
182
182
  [key: string]: React.ReactInstance;
183
183
  };
184
184
  componentDidMount?(): void;
185
- shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
185
+ shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
186
186
  locale?: string | undefined;
187
187
  translate?: ((str: string, ...args: any[]) => string) | undefined;
188
188
  }>, nextState: Readonly<{}>, nextContext: any): boolean;
189
189
  componentWillUnmount?(): void;
190
190
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
191
- getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
191
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
192
192
  locale?: string | undefined;
193
193
  translate?: ((str: string, ...args: any[]) => string) | undefined;
194
194
  }>, prevState: Readonly<{}>): any;
195
- componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
195
+ componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
196
196
  locale?: string | undefined;
197
197
  translate?: ((str: string, ...args: any[]) => string) | undefined;
198
198
  }>, prevState: Readonly<{}>, snapshot?: any): void;
199
199
  componentWillMount?(): void;
200
200
  UNSAFE_componentWillMount?(): void;
201
- componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
201
+ componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
202
202
  locale?: string | undefined;
203
203
  translate?: ((str: string, ...args: any[]) => string) | undefined;
204
204
  }>, nextContext: any): void;
205
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
205
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
206
206
  locale?: string | undefined;
207
207
  translate?: ((str: string, ...args: any[]) => string) | undefined;
208
208
  }>, nextContext: any): void;
209
- componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
209
+ componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
210
210
  locale?: string | undefined;
211
211
  translate?: ((str: string, ...args: any[]) => string) | undefined;
212
212
  }>, nextState: Readonly<{}>, nextContext: any): void;
213
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
213
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
214
214
  locale?: string | undefined;
215
215
  translate?: ((str: string, ...args: any[]) => string) | undefined;
216
216
  }>, nextState: Readonly<{}>, nextContext: any): void;
@@ -222,7 +222,7 @@ declare const _default: {
222
222
  ComposedComponent: typeof FormulaEditor;
223
223
  }>;
224
224
  } & import("hoist-non-react-statics").NonReactStatics<{
225
- new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
225
+ new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
226
226
  locale?: string | undefined;
227
227
  translate?: ((str: string, ...args: any[]) => string) | undefined;
228
228
  }): {
@@ -231,12 +231,12 @@ declare const _default: {
231
231
  getWrappedInstance(): any;
232
232
  render(): JSX.Element;
233
233
  context: any;
234
- setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
234
+ setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
235
235
  locale?: string | undefined;
236
236
  translate?: ((str: string, ...args: any[]) => string) | undefined;
237
237
  }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
238
238
  forceUpdate(callback?: (() => void) | undefined): void;
239
- readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
239
+ readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
240
240
  locale?: string | undefined;
241
241
  translate?: ((str: string, ...args: any[]) => string) | undefined;
242
242
  }> & Readonly<{
@@ -247,35 +247,35 @@ declare const _default: {
247
247
  [key: string]: React.ReactInstance;
248
248
  };
249
249
  componentDidMount?(): void;
250
- shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
250
+ shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
251
251
  locale?: string | undefined;
252
252
  translate?: ((str: string, ...args: any[]) => string) | undefined;
253
253
  }>, nextState: Readonly<{}>, nextContext: any): boolean;
254
254
  componentWillUnmount?(): void;
255
255
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
256
- getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
256
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
257
257
  locale?: string | undefined;
258
258
  translate?: ((str: string, ...args: any[]) => string) | undefined;
259
259
  }>, prevState: Readonly<{}>): any;
260
- componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
260
+ componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
261
261
  locale?: string | undefined;
262
262
  translate?: ((str: string, ...args: any[]) => string) | undefined;
263
263
  }>, prevState: Readonly<{}>, snapshot?: any): void;
264
264
  componentWillMount?(): void;
265
265
  UNSAFE_componentWillMount?(): void;
266
- componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
266
+ componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
267
267
  locale?: string | undefined;
268
268
  translate?: ((str: string, ...args: any[]) => string) | undefined;
269
269
  }>, nextContext: any): void;
270
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
270
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
271
271
  locale?: string | undefined;
272
272
  translate?: ((str: string, ...args: any[]) => string) | undefined;
273
273
  }>, nextContext: any): void;
274
- componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
274
+ componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
275
275
  locale?: string | undefined;
276
276
  translate?: ((str: string, ...args: any[]) => string) | undefined;
277
277
  }>, nextState: Readonly<{}>, nextContext: any): void;
278
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
278
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
279
279
  locale?: string | undefined;
280
280
  translate?: ((str: string, ...args: any[]) => string) | undefined;
281
281
  }>, nextState: Readonly<{}>, nextContext: any): void;
@@ -287,7 +287,7 @@ declare const _default: {
287
287
  ComposedComponent: typeof FormulaEditor;
288
288
  }, {}> & {
289
289
  ComposedComponent: {
290
- new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
290
+ new (props: Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
291
291
  locale?: string | undefined;
292
292
  translate?: ((str: string, ...args: any[]) => string) | undefined;
293
293
  }): {
@@ -296,12 +296,12 @@ declare const _default: {
296
296
  getWrappedInstance(): any;
297
297
  render(): JSX.Element;
298
298
  context: any;
299
- setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
299
+ setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
300
300
  locale?: string | undefined;
301
301
  translate?: ((str: string, ...args: any[]) => string) | undefined;
302
302
  }>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
303
303
  forceUpdate(callback?: (() => void) | undefined): void;
304
- readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
304
+ readonly props: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
305
305
  locale?: string | undefined;
306
306
  translate?: ((str: string, ...args: any[]) => string) | undefined;
307
307
  }> & Readonly<{
@@ -312,35 +312,35 @@ declare const _default: {
312
312
  [key: string]: React.ReactInstance;
313
313
  };
314
314
  componentDidMount?(): void;
315
- shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
315
+ shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
316
316
  locale?: string | undefined;
317
317
  translate?: ((str: string, ...args: any[]) => string) | undefined;
318
318
  }>, nextState: Readonly<{}>, nextContext: any): boolean;
319
319
  componentWillUnmount?(): void;
320
320
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
321
- getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
321
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
322
322
  locale?: string | undefined;
323
323
  translate?: ((str: string, ...args: any[]) => string) | undefined;
324
324
  }>, prevState: Readonly<{}>): any;
325
- componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
325
+ componentDidUpdate?(prevProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
326
326
  locale?: string | undefined;
327
327
  translate?: ((str: string, ...args: any[]) => string) | undefined;
328
328
  }>, prevState: Readonly<{}>, snapshot?: any): void;
329
329
  componentWillMount?(): void;
330
330
  UNSAFE_componentWillMount?(): void;
331
- componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
331
+ componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
332
332
  locale?: string | undefined;
333
333
  translate?: ((str: string, ...args: any[]) => string) | undefined;
334
334
  }>, nextContext: any): void;
335
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
335
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
336
336
  locale?: string | undefined;
337
337
  translate?: ((str: string, ...args: any[]) => string) | undefined;
338
338
  }>, nextContext: any): void;
339
- componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
339
+ componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
340
340
  locale?: string | undefined;
341
341
  translate?: ((str: string, ...args: any[]) => string) | undefined;
342
342
  }>, nextState: Readonly<{}>, nextContext: any): void;
343
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "selfVariableName" | "variableMode" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
343
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "classPrefix" | "classnames" | "header" | "className" | "theme" | "value" | "onChange" | "functions" | "variableMode" | "onlyVariable" | "variableClassName" | "functionClassName"> & Partial<Pick<Omit<FormulaEditorProps, keyof LocaleProps>, "evalMode" | "variables">> & Partial<Pick<Pick<FormulaEditorProps, "evalMode" | "variables">, never>> & {
344
344
  locale?: string | undefined;
345
345
  translate?: ((str: string, ...args: any[]) => string) | undefined;
346
346
  }>, nextState: Readonly<{}>, nextContext: any): void;
@@ -16,7 +16,6 @@ var CodeMirror_1 = (0, tslib_1.__importDefault)(require("../CodeMirror"));
16
16
  var helper_1 = require("../../utils/helper");
17
17
  var theme_1 = require("../../theme");
18
18
  var locale_1 = require("../../locale");
19
- var Toast_1 = require("../Toast");
20
19
  var FormulaEditor = /** @class */ (function (_super) {
21
20
  (0, tslib_1.__extends)(FormulaEditor, _super);
22
21
  function FormulaEditor() {
@@ -115,10 +114,16 @@ var FormulaEditor = /** @class */ (function (_super) {
115
114
  };
116
115
  FormulaEditor.prototype.handleVariableSelect = function (item) {
117
116
  var _a;
118
- var _b = this.props, evalMode = _b.evalMode, selfVariableName = _b.selfVariableName;
119
- if (item && item.label && selfVariableName === item.label) {
120
- Toast_1.toast.warning('不能使用当前变量[self],避免循环引用。');
121
- return;
117
+ var _b = this.props, onlyVariable = _b.onlyVariable, evalMode = _b.evalMode;
118
+ // 只展示变量时,选择即提交
119
+ if (onlyVariable) {
120
+ var onChange = this.props.onChange;
121
+ var value = item.value
122
+ ? evalMode
123
+ ? item.value
124
+ : '${' + item.value + '}'
125
+ : '';
126
+ return onChange === null || onChange === void 0 ? void 0 : onChange(value);
122
127
  }
123
128
  (_a = this.editorPlugin) === null || _a === void 0 ? void 0 : _a.insertContent({
124
129
  key: item.value,
@@ -133,22 +138,22 @@ var FormulaEditor = /** @class */ (function (_super) {
133
138
  return (0, plugin_1.editorFactory)(dom, cm, this.props);
134
139
  };
135
140
  FormulaEditor.prototype.render = function () {
136
- var _a = this.props, variables = _a.variables, header = _a.header, value = _a.value, functions = _a.functions, variableMode = _a.variableMode, __ = _a.translate, cx = _a.classnames, variableClassName = _a.variableClassName, functionClassName = _a.functionClassName, classPrefix = _a.classPrefix, selfVariableName = _a.selfVariableName;
141
+ var _a = this.props, variables = _a.variables, header = _a.header, value = _a.value, functions = _a.functions, variableMode = _a.variableMode, onlyVariable = _a.onlyVariable, __ = _a.translate, cx = _a.classnames, variableClassName = _a.variableClassName, functionClassName = _a.functionClassName, classPrefix = _a.classPrefix;
137
142
  var focused = this.state.focused;
138
143
  var customFunctions = Array.isArray(functions) ? functions : [];
139
144
  var functionList = (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], FormulaEditor.buildDefaultFunctions(doc_1.doc), true), customFunctions, true);
140
145
  return (react_1.default.createElement("div", { className: cx("FormulaEditor", {
141
146
  'is-focused': focused
142
147
  }) },
143
- react_1.default.createElement("section", { className: cx("FormulaEditor-content") },
148
+ onlyVariable ? null : (react_1.default.createElement("section", { className: cx("FormulaEditor-content") },
144
149
  react_1.default.createElement("header", { className: cx("FormulaEditor-header") }, __(header || 'FormulaEditor.title')),
145
- react_1.default.createElement(CodeMirror_1.default, { className: cx('FormulaEditor-editor'), value: value, onChange: this.handleOnChange, editorFactory: this.editorFactory, editorDidMount: this.handleEditorMounted, onFocus: this.handleFocus, onBlur: this.handleBlur })),
146
- react_1.default.createElement("section", { className: cx('FormulaEditor-settings') },
150
+ react_1.default.createElement(CodeMirror_1.default, { className: cx('FormulaEditor-editor'), value: value, onChange: this.handleOnChange, editorFactory: this.editorFactory, editorDidMount: this.handleEditorMounted, onFocus: this.handleFocus, onBlur: this.handleBlur }))),
151
+ react_1.default.createElement("section", { className: cx('FormulaEditor-settings', onlyVariable ? 'only-variable' : '') },
147
152
  react_1.default.createElement("div", { className: cx('FormulaEditor-panel') },
148
153
  variableMode !== 'tabs' ? (react_1.default.createElement("div", { className: cx('FormulaEditor-panel-header') }, __('FormulaEditor.variable'))) : null,
149
154
  react_1.default.createElement("div", { className: cx('FormulaEditor-panel-body', variableMode && "FormulaEditor-panel-body--".concat(variableMode)) },
150
- react_1.default.createElement(VariableList_1.default, { classPrefix: classPrefix, className: cx('FormulaEditor-VariableList', 'FormulaEditor-VariableList-root', variableClassName), selectMode: variableMode, data: variables, onSelect: this.handleVariableSelect, selfVariableName: selfVariableName }))),
151
- react_1.default.createElement(FuncList_1.default, { className: functionClassName, title: __('FormulaEditor.function'), data: functionList, onSelect: this.handleFunctionSelect }))));
155
+ react_1.default.createElement(VariableList_1.default, { classPrefix: classPrefix, className: cx('FormulaEditor-VariableList', 'FormulaEditor-VariableList-root', variableClassName), selectMode: variableMode, data: variables, onSelect: this.handleVariableSelect }))),
156
+ onlyVariable ? null : (react_1.default.createElement(FuncList_1.default, { className: functionClassName, title: __('FormulaEditor.function'), data: functionList, onSelect: this.handleFunctionSelect })))));
152
157
  };
153
158
  var _a;
154
159
  FormulaEditor.defaultProps = {
@@ -6,8 +6,8 @@
6
6
  "/src/components/formula/Editor.tsx"
7
7
  ],
8
8
  "names": [],
9
- "mappings": ";;;;AAAA;;GAEG;AACH,6DAA0B;AAC1B,iDAA8C;AAC9C,6CAAmC;AACnC,6CAA0C;AAE1C,mCAAsD;AACtD,qEAAkC;AAClC,6EAA0C;AAC1C,0EAA6C;AAC7C,6CAAsD;AACtD,qCAAkD;AAClD,uCAAqD;AACrD,kCAA+B;AAgF/B;IAAmC,8CAGlC;IAHD;QAAA,qEAkPC;QA9OC,WAAK,GAAiB;YACpB,OAAO,EAAE,KAAK;SACf,CAAC;;IA4OJ,CAAC;IAzOQ,mCAAqB,GAA5B,UACE,GAIE;QAEF,IAAM,KAAK,GAAqB,EAAE,CAAC;QAEnC,GAAG,CAAC,OAAO,CAAC,UAAA,IAAI;YACd,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC;YAC7C,IAAI,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,SAAS,KAAK,SAAS,EAA5B,CAA4B,CAAC,CAAC;YAC9D,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,GAAG;oBACP,SAAS,EAAE,SAAS;oBACpB,K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IAAI,CAAC,CAAC,CAAC,CACrB,8BAAC,kBAAQ,IACP,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,EACnC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,IAAI,CAAC,oBAAoB,GACnC,CACH,CACO,CACN,CACP,CAAC;IACJ,CAAC;;IA7NM,0BAAY,GAAuD;QACxE,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,IAAI;KACf,CAAC;IAkDF;QADC,iBAAQ;;;;oDAKR;IAGD;QADC,iBAAQ;;;;mDAKR;IAGD;QADC,iBAAQ;;;;oDAGR;IAGD;QADC,iBAAQ;;;;4DAGR;IAGD;QADC,iBAAQ;;;;iDAeR;IAGD;QADC,iBAAQ;;;;6DAGR;IAGD;QADC,iBAAQ;;;;6DAsBR;IAGD;QADC,iBAAQ;;;;uDAIR;IAGD;QADC,iBAAQ;;0EACU,WAAW,oBAAX,WAAW;;sDAE7B;IA2FH,oBAAC;CAAA,AAhQD,CAAmC,eAAK,CAAC,SAAS,GAgQjD;AAhQY,sCAAa;AAkQ1B,kBAAe,IAAA,+BAAc,EAC3B,IAAA,iBAAS,EAAC,IAAA,mBAAU,EAAC,aAAa,CAAC,CAAC,EACpC;IACE,KAAK,EAAE,UAAU;CAClB,EACD,CAAC,UAAU,CAAC,CACb,CAAC",
10
10
  "sourcesContent": [
11
- "/**\n * @file 公式编辑器\n */\nimport React from 'react';\nimport {uncontrollable} from 'uncontrollable';\nimport {parse} from 'amis-formula';\nimport {doc} from 'amis-formula/dist/doc';\n\nimport {FormulaPlugin, editorFactory} from './plugin';\nimport FuncList from './FuncList';\nimport VariableList from './VariableList';\nimport CodeMirrorEditor from '../CodeMirror';\nimport {autobind, eachTree} from '../../utils/helper';\nimport {themeable, ThemeProps} from '../../theme';\nimport {localeable, LocaleProps} from '../../locale';\nimport {toast} from '../Toast';\n\nexport interface VariableItem {\n label: string;\n value?: string;\n children?: Array<VariableItem>;\n type?: string;\n tag?: string;\n selectMode?: 'tree' | 'tabs';\n}\n\nexport interface FuncGroup {\n groupName: string;\n items: Array<FuncItem>;\n}\n\nexport interface FuncItem {\n name: string; // 函数名\n example?: string; // 示例\n description?: string; // 描述\n [propName: string]: any;\n}\n\nexport interface FormulaEditorProps extends ThemeProps, LocaleProps {\n onChange?: (value: string) => void;\n value?: string;\n /**\n * evalMode 即直接就是表达式,否则\n * 需要 ${这里面才是表达式}\n * 默认为 true\n */\n evalMode?: boolean;\n\n /**\n * 用于提示的变量集合,默认为空\n */\n variables?: Array<VariableItem>;\n\n /**\n * 变量展现模式,可选值:'tabs' | 'tree'\n */\n variableMode?: 'tabs' | 'tree';\n\n /**\n * 函数集合,默认不需要传,即 amis-formula 里面那个函数\n * 如果有扩充,则需要传。\n */\n functions?: Array<FuncGroup>;\n\n /**\n * 顶部标题,默认为表达式\n */\n header: string;\n\n variableClassName?: string;\n\n functionClassName?: string;\n\n /**\n * 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染\n */\n selfVariableName?: string;\n}\n\nexport interface FunctionsProps {\n name: string;\n items: FunctionProps[];\n}\n\nexport interface FunctionProps {\n name: string;\n intro: string;\n usage: string;\n example: string;\n}\n\nexport interface FormulaState {\n focused: boolean;\n}\n\nexport class FormulaEditor extends React.Component<\n FormulaEditorProps,\n FormulaState\n> {\n state: FormulaState = {\n focused: false\n };\n editorPlugin?: FormulaPlugin;\n\n static buildDefaultFunctions(\n doc: Array<{\n namespace: string;\n name: string;\n [propName: string]: any;\n }>\n ) {\n const funcs: Array<FuncGroup> = [];\n\n doc.forEach(item => {\n const namespace = item.namespace || 'Others';\n let exists = funcs.find(item => item.groupName === namespace);\n if (!exists) {\n exists = {\n groupName: namespace,\n items: []\n };\n funcs.push(exists);\n }\n exists.items.push(item);\n });\n\n return funcs;\n }\n\n static defaultProps: Pick<FormulaEditorProps, 'variables' | 'evalMode'> = {\n variables: [],\n evalMode: true\n };\n\n static highlightValue(\n value: string,\n variables: Array<VariableItem>,\n evalMode: boolean = true\n ) {\n if (!Array.isArray(variables) || !variables.length || !value) {\n return;\n }\n\n const varMap: {\n [propname: string]: string;\n } = {};\n\n eachTree(variables, item => {\n if (item.value) {\n const key = item.value;\n varMap[key] = item.label;\n }\n });\n const vars = Object.keys(varMap)\n .filter(item => item)\n .sort((a, b) => b.length - a.length);\n\n const content = value || '';\n let html = '';\n\n // 标记方法调用\n html = content.replace(/([A-Z]+)\\s*\\(/g, (_, func, pos) => {\n return _?.replace(func, `<span class=\"c-func\">${func}</span>`);\n });\n\n vars.forEach(v => {\n let from = 0;\n let idx = -1;\n while (~(idx = content.indexOf(v, from))) {\n html = html.replace(v, `<span class=\"c-field\">${varMap[v]}</span>`);\n from = idx + v.length;\n }\n });\n\n return {html};\n }\n\n componentWillUnmount() {\n this.editorPlugin?.dispose();\n }\n\n @autobind\n handleFocus() {\n this.setState({\n focused: true\n });\n }\n\n @autobind\n handleBlur() {\n this.setState({\n focused: false\n });\n }\n\n @autobind\n insertValue(value: any, type: 'variable' | 'func') {\n this.editorPlugin?.insertContent(value, type);\n }\n\n @autobind\n handleEditorMounted(cm: any, editor: any) {\n this.editorPlugin = new FormulaPlugin(editor, cm, () => this.props);\n }\n\n @autobind\n validate() {\n const value = this.props.value;\n\n try {\n value\n ? parse(value, {\n evalMode: this.props.evalMode\n })\n : null;\n } catch (e) {\n return e.message;\n }\n\n return;\n }\n\n @autobind\n handleFunctionSelect(item: FuncItem) {\n this.editorPlugin?.insertContent(`${item.name}`, 'func');\n }\n\n @autobind\n handleVariableSelect(item: VariableItem) {\n const {evalMode, selfVariableName} = this.props;\n\n if (item && item.label && selfVariableName === item.label) {\n toast.warning('不能使用当前变量[self],避免循环引用。');\n return;\n }\n\n this.editorPlugin?.insertContent(\n {\n key: item.value,\n name: item.label\n },\n 'variable'\n );\n }\n\n @autobind\n handleOnChange(value: any) {\n const onChange = this.props.onChange;\n onChange?.(value);\n }\n\n @autobind\n editorFactory(dom: HTMLElement, cm: any) {\n return editorFactory(dom, cm, this.props);\n }\n\n render() {\n const {\n variables,\n header,\n value,\n functions,\n variableMode,\n translate: __,\n classnames: cx,\n variableClassName,\n functionClassName,\n classPrefix,\n selfVariableName\n } = this.props;\n const {focused} = this.state;\n const customFunctions = Array.isArray(functions) ? functions : [];\n const functionList = [\n ...FormulaEditor.buildDefaultFunctions(doc),\n ...customFunctions\n ];\n\n return (\n <div\n className={cx(`FormulaEditor`, {\n 'is-focused': focused\n })}\n >\n <section className={cx(`FormulaEditor-content`)}>\n <header className={cx(`FormulaEditor-header`)}>\n {__(header || 'FormulaEditor.title')}\n </header>\n\n <CodeMirrorEditor\n className={cx('FormulaEditor-editor')}\n value={value}\n onChange={this.handleOnChange}\n editorFactory={this.editorFactory}\n editorDidMount={this.handleEditorMounted}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </section>\n\n <section className={cx('FormulaEditor-settings')}>\n <div className={cx('FormulaEditor-panel')}>\n {variableMode !== 'tabs' ? (\n <div className={cx('FormulaEditor-panel-header')}>\n {__('FormulaEditor.variable')}\n </div>\n ) : null}\n <div\n className={cx(\n 'FormulaEditor-panel-body',\n variableMode && `FormulaEditor-panel-body--${variableMode}`\n )}\n >\n <VariableList\n classPrefix={classPrefix}\n className={cx(\n 'FormulaEditor-VariableList',\n 'FormulaEditor-VariableList-root',\n variableClassName\n )}\n selectMode={variableMode}\n data={variables!}\n onSelect={this.handleVariableSelect}\n selfVariableName={selfVariableName}\n />\n </div>\n </div>\n\n <FuncList\n className={functionClassName}\n title={__('FormulaEditor.function')}\n data={functionList}\n onSelect={this.handleFunctionSelect}\n />\n </section>\n </div>\n );\n }\n}\n\nexport default uncontrollable(\n themeable(localeable(FormulaEditor)),\n {\n value: 'onChange'\n },\n ['validate']\n);\n"
11
+ "/**\n * @file 公式编辑器\n */\nimport React from 'react';\nimport {uncontrollable} from 'uncontrollable';\nimport {parse} from 'amis-formula';\nimport {doc} from 'amis-formula/dist/doc';\n\nimport {FormulaPlugin, editorFactory} from './plugin';\nimport FuncList from './FuncList';\nimport VariableList from './VariableList';\nimport CodeMirrorEditor from '../CodeMirror';\nimport {autobind, eachTree} from '../../utils/helper';\nimport {themeable, ThemeProps} from '../../theme';\nimport {localeable, LocaleProps} from '../../locale';\n\nexport interface VariableItem {\n label: string;\n value?: string;\n children?: Array<VariableItem>;\n type: '';\n tag?: string;\n selectMode?: 'tree' | 'tabs';\n}\n\nexport interface FuncGroup {\n groupName: string;\n items: Array<FuncItem>;\n}\n\nexport interface FuncItem {\n name: string; // 函数名\n example?: string; // 示例\n description?: string; // 描述\n [propName: string]: any;\n}\n\nexport interface FormulaEditorProps extends ThemeProps, LocaleProps {\n onChange?: (value: string) => void;\n value?: string;\n /**\n * evalMode 即直接就是表达式,否则\n * 需要 ${这里面才是表达式}\n * 默认为 true\n */\n evalMode?: boolean;\n\n /**\n * 用于提示的变量集合,默认为空\n */\n variables?: Array<VariableItem>;\n\n /**\n * 变量展现模式,可选值:'tabs' | 'tree'\n */\n variableMode?: 'tabs' | 'tree';\n\n /**\n * 只展示变量,不需要其他面板\n */\n onlyVariable?: boolean;\n\n /**\n * 函数集合,默认不需要传,即 amis-formula 里面那个函数\n * 如果有扩充,则需要传。\n */\n functions?: Array<FuncGroup>;\n\n /**\n * 顶部标题,默认为表达式\n */\n header: string;\n\n variableClassName?: string;\n\n functionClassName?: string;\n}\n\nexport interface FunctionsProps {\n name: string;\n items: FunctionProps[];\n}\n\nexport interface FunctionProps {\n name: string;\n intro: string;\n usage: string;\n example: string;\n}\n\nexport interface FormulaState {\n focused: boolean;\n}\n\nexport class FormulaEditor extends React.Component<\n FormulaEditorProps,\n FormulaState\n> {\n state: FormulaState = {\n focused: false\n };\n editorPlugin?: FormulaPlugin;\n\n static buildDefaultFunctions(\n doc: Array<{\n namespace: string;\n name: string;\n [propName: string]: any;\n }>\n ) {\n const funcs: Array<FuncGroup> = [];\n\n doc.forEach(item => {\n const namespace = item.namespace || 'Others';\n let exists = funcs.find(item => item.groupName === namespace);\n if (!exists) {\n exists = {\n groupName: namespace,\n items: []\n };\n funcs.push(exists);\n }\n exists.items.push(item);\n });\n\n return funcs;\n }\n\n static defaultProps: Pick<FormulaEditorProps, 'variables' | 'evalMode'> = {\n variables: [],\n evalMode: true\n };\n\n static highlightValue(\n value: string,\n variables: Array<VariableItem>,\n evalMode: boolean = true\n ) {\n if (!Array.isArray(variables) || !variables.length || !value) {\n return;\n }\n\n const varMap: {\n [propname: string]: string;\n } = {};\n\n eachTree(variables, item => {\n if (item.value) {\n const key = item.value;\n varMap[key] = item.label;\n }\n });\n const vars = Object.keys(varMap)\n .filter(item => item)\n .sort((a, b) => b.length - a.length);\n\n const content = value || '';\n let html = '';\n\n // 标记方法调用\n html = content.replace(/([A-Z]+)\\s*\\(/g, (_, func, pos) => {\n return _?.replace(func, `<span class=\"c-func\">${func}</span>`);\n });\n\n vars.forEach(v => {\n let from = 0;\n let idx = -1;\n while (~(idx = content.indexOf(v, from))) {\n html = html.replace(v, `<span class=\"c-field\">${varMap[v]}</span>`);\n from = idx + v.length;\n }\n });\n\n return {html};\n }\n\n componentWillUnmount() {\n this.editorPlugin?.dispose();\n }\n\n @autobind\n handleFocus() {\n this.setState({\n focused: true\n });\n }\n\n @autobind\n handleBlur() {\n this.setState({\n focused: false\n });\n }\n\n @autobind\n insertValue(value: any, type: 'variable' | 'func') {\n this.editorPlugin?.insertContent(value, type);\n }\n\n @autobind\n handleEditorMounted(cm: any, editor: any) {\n this.editorPlugin = new FormulaPlugin(editor, cm, () => this.props);\n }\n\n @autobind\n validate() {\n const value = this.props.value;\n\n try {\n value\n ? parse(value, {\n evalMode: this.props.evalMode\n })\n : null;\n } catch (e) {\n return e.message;\n }\n\n return;\n }\n\n @autobind\n handleFunctionSelect(item: FuncItem) {\n this.editorPlugin?.insertContent(`${item.name}`, 'func');\n }\n\n @autobind\n handleVariableSelect(item: VariableItem) {\n const {onlyVariable, evalMode} = this.props;\n\n // 只展示变量时,选择即提交\n if (onlyVariable) {\n const onChange = this.props.onChange;\n const value = item.value\n ? evalMode\n ? item.value\n : '${' + item.value + '}'\n : '';\n return onChange?.(value);\n }\n\n this.editorPlugin?.insertContent(\n {\n key: item.value,\n name: item.label\n },\n 'variable'\n );\n }\n\n @autobind\n handleOnChange(value: any) {\n const onChange = this.props.onChange;\n onChange?.(value);\n }\n\n @autobind\n editorFactory(dom: HTMLElement, cm: any) {\n return editorFactory(dom, cm, this.props);\n }\n\n render() {\n const {\n variables,\n header,\n value,\n functions,\n variableMode,\n onlyVariable,\n translate: __,\n classnames: cx,\n variableClassName,\n functionClassName,\n classPrefix\n } = this.props;\n const {focused} = this.state;\n const customFunctions = Array.isArray(functions) ? functions : [];\n const functionList = [\n ...FormulaEditor.buildDefaultFunctions(doc),\n ...customFunctions\n ];\n\n return (\n <div\n className={cx(`FormulaEditor`, {\n 'is-focused': focused\n })}\n >\n {onlyVariable ? null : (\n <section className={cx(`FormulaEditor-content`)}>\n <header className={cx(`FormulaEditor-header`)}>\n {__(header || 'FormulaEditor.title')}\n </header>\n\n <CodeMirrorEditor\n className={cx('FormulaEditor-editor')}\n value={value}\n onChange={this.handleOnChange}\n editorFactory={this.editorFactory}\n editorDidMount={this.handleEditorMounted}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </section>\n )}\n\n <section\n className={cx(\n 'FormulaEditor-settings',\n onlyVariable ? 'only-variable' : ''\n )}\n >\n <div className={cx('FormulaEditor-panel')}>\n {variableMode !== 'tabs' ? (\n <div className={cx('FormulaEditor-panel-header')}>\n {__('FormulaEditor.variable')}\n </div>\n ) : null}\n <div\n className={cx(\n 'FormulaEditor-panel-body',\n variableMode && `FormulaEditor-panel-body--${variableMode}`\n )}\n >\n <VariableList\n classPrefix={classPrefix}\n className={cx(\n 'FormulaEditor-VariableList',\n 'FormulaEditor-VariableList-root',\n variableClassName\n )}\n selectMode={variableMode}\n data={variables!}\n onSelect={this.handleVariableSelect}\n />\n </div>\n </div>\n\n {onlyVariable ? null : (\n <FuncList\n className={functionClassName}\n title={__('FormulaEditor.function')}\n data={functionList}\n onSelect={this.handleFunctionSelect}\n />\n )}\n </section>\n </div>\n );\n }\n}\n\nexport default uncontrollable(\n themeable(localeable(FormulaEditor)),\n {\n value: 'onChange'\n },\n ['validate']\n);\n"
12
12
  ]
13
13
  }