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.
- package/lib/components/AssociatedSelection.d.ts +40 -40
- package/lib/components/Badge.d.ts +1 -1
- package/lib/components/Badge.js.map +1 -1
- package/lib/components/ChainedSelection.d.ts +40 -40
- package/lib/components/GroupedSelection.d.ts +40 -40
- package/lib/components/GroupedSelection.js +2 -3
- package/lib/components/GroupedSelection.js.map +2 -2
- package/lib/components/PickerContainer.d.ts +0 -1
- package/lib/components/PickerContainer.js +4 -4
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/ResultBox.js +3 -1
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/ResultList.d.ts +53 -43
- package/lib/components/ResultList.js +22 -34
- package/lib/components/ResultList.js.map +2 -2
- package/lib/components/ResultTableList.d.ts +40 -40
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/Select.js +10 -6
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Selection.d.ts +40 -41
- package/lib/components/Selection.js.map +2 -2
- package/lib/components/TableSelection.d.ts +40 -40
- package/lib/components/TabsTransfer.d.ts +2 -2
- package/lib/components/TabsTransfer.js.map +1 -1
- package/lib/components/Transfer.d.ts +40 -40
- package/lib/components/Transfer.js +1 -1
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +40 -40
- package/lib/components/TreeSelection.d.ts +40 -40
- package/lib/components/TreeSelection.js +2 -3
- package/lib/components/TreeSelection.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +45 -45
- package/lib/components/formula/Editor.js +16 -11
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/Picker.d.ts +85 -40
- package/lib/components/formula/Picker.js +12 -6
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/components/formula/VariableList.d.ts +0 -2
- package/lib/components/formula/VariableList.js +5 -15
- package/lib/components/formula/VariableList.js.map +2 -2
- package/lib/components/index.d.ts +1 -3
- package/lib/components/index.js +1 -5
- package/lib/components/index.js.map +2 -2
- package/lib/components/schema-editor/SchemaVariableList.d.ts +0 -1
- package/lib/components/schema-editor/SchemaVariableList.js +2 -2
- package/lib/components/schema-editor/SchemaVariableList.js.map +2 -2
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +0 -1
- package/lib/components/schema-editor/SchemaVariableListPicker.js +2 -2
- package/lib/components/schema-editor/SchemaVariableListPicker.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/index.js +1 -1
- package/lib/renderers/CRUD.js +3 -3
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +66 -20
- package/lib/renderers/Form/Editor.d.ts +66 -20
- package/lib/renderers/Form/Group.js +1 -1
- package/lib/renderers/Form/Group.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +5 -5
- package/lib/renderers/Form/InputFormula.js +4 -3
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- package/lib/renderers/Form/InputTag.d.ts +1 -1
- package/lib/renderers/Form/InputTag.js.map +1 -1
- package/lib/renderers/Form/Options.js +7 -7
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +6 -1
- package/lib/renderers/Form/Select.js +3 -1
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +0 -1
- package/lib/renderers/Form/TreeSelect.js +1 -9
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.js +9 -4
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Table/exportExcel.js +1 -1
- package/lib/renderers/Table/exportExcel.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +2 -0
- package/lib/renderers/Table/index.js +37 -5
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tpl.d.ts +4 -0
- package/lib/renderers/Tpl.js +6 -3
- package/lib/renderers/Tpl.js.map +2 -2
- package/lib/store/combo.d.ts +72 -22
- package/lib/store/form.d.ts +30 -9
- package/lib/store/form.js +28 -10
- package/lib/store/form.js.map +2 -2
- package/lib/store/formItem.d.ts +3 -1
- package/lib/store/formItem.js +3 -5
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/table.d.ts +60 -18
- package/lib/themes/ang-ie11.css +33 -9
- package/lib/themes/ang.css +27 -9
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +33 -9
- package/lib/themes/antd.css +27 -9
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +35 -15
- package/lib/themes/cxd.css +31 -17
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +33 -9
- package/lib/themes/dark.css +27 -9
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +35 -15
- package/lib/themes/default.css +31 -17
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/formula.js +2 -3
- package/lib/utils/formula.js.map +2 -2
- package/lib/utils/helper.js +1 -1
- package/lib/utils/helper.js.map +2 -2
- package/package.json +1 -1
- package/schema.json +22 -16
- package/scss/_mixins.scss +1 -1
- package/scss/components/form/_date.scss +9 -10
- package/scss/components/form/_select.scss +14 -0
- package/scss/components/form/_transfer.scss +1 -2
- package/scss/themes/cxd.scss +4 -9
- package/sdk/ang-ie11.css +36 -9
- package/sdk/ang.css +30 -9
- package/sdk/antd-ie11.css +36 -9
- package/sdk/antd.css +30 -9
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +38 -16
- package/sdk/cxd.css +34 -18
- package/sdk/dark-ie11.css +36 -9
- package/sdk/dark.css +30 -9
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +38 -16
- package/sdk/sdk.css +34 -18
- package/sdk/sdk.js +1356 -1354
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/components/Badge.tsx +1 -1
- package/src/components/GroupedSelection.tsx +2 -3
- package/src/components/PickerContainer.tsx +8 -13
- package/src/components/ResultBox.tsx +3 -1
- package/src/components/ResultList.tsx +51 -48
- package/src/components/Select.tsx +16 -8
- package/src/components/Selection.tsx +0 -1
- package/src/components/TabsTransfer.tsx +2 -2
- package/src/components/Transfer.tsx +4 -0
- package/src/components/TreeSelection.tsx +1 -2
- package/src/components/formula/Editor.tsx +51 -38
- package/src/components/formula/Picker.tsx +26 -7
- package/src/components/formula/VariableList.tsx +2 -36
- package/src/components/index.tsx +0 -4
- package/src/components/schema-editor/SchemaVariableList.tsx +2 -4
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +1 -4
- package/src/renderers/CRUD.tsx +3 -3
- package/src/renderers/Form/Group.tsx +1 -1
- package/src/renderers/Form/InputFormula.tsx +11 -10
- package/src/renderers/Form/InputTag.tsx +1 -1
- package/src/renderers/Form/Options.tsx +7 -9
- package/src/renderers/Form/Select.tsx +10 -2
- package/src/renderers/Form/TreeSelect.tsx +14 -16
- package/src/renderers/Form/index.tsx +13 -2
- package/src/renderers/Table/exportExcel.ts +1 -1
- package/src/renderers/Table/index.tsx +42 -6
- package/src/renderers/Tpl.tsx +11 -1
- package/src/store/form.ts +31 -24
- package/src/store/formItem.ts +65 -52
- package/src/utils/formula.ts +2 -2
- 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
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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" | "
|
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,
|
119
|
-
|
120
|
-
|
121
|
-
|
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
|
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
|
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;
|
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;AAgFrD;IAAmC,8CAGlC;IAHD;QAAA,qEAgQC;QA5PC,WAAK,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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';\
|
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
|
}
|