diff --git a/packages/amis-formula/src/parser.ts b/packages/amis-formula/src/parser.ts index 632570dda..2c73800e8 100644 --- a/packages/amis-formula/src/parser.ts +++ b/packages/amis-formula/src/parser.ts @@ -62,7 +62,7 @@ export function parse(input: string, options?: ParserOptions): ASTNode { function fatal() { throw TypeError( - `Unexpected token ${token!.value} in ${token!.start.line}:${ + `Unexpected token ${token!.value || token.type} in ${token!.start.line}:${ token!.start.column }` ); diff --git a/packages/amis-ui/scss/components/_condition-builder.scss b/packages/amis-ui/scss/components/_condition-builder.scss index 266477360..f51bb8ee9 100644 --- a/packages/amis-ui/scss/components/_condition-builder.scss +++ b/packages/amis-ui/scss/components/_condition-builder.scss @@ -439,6 +439,7 @@ display: flex; flex: 1; min-width: 0; + flex-wrap: wrap; > * { flex-shrink: 0; @@ -451,7 +452,7 @@ vertical-align: middle; margin: px2rem(3px); flex: 1; - min-width: 0; + min-width: px2rem(100px); } .#{$ns}CBFormula { diff --git a/packages/amis-ui/src/components/CodeMirror.tsx b/packages/amis-ui/src/components/CodeMirror.tsx index 1b551cd07..9c8e99bd9 100644 --- a/packages/amis-ui/src/components/CodeMirror.tsx +++ b/packages/amis-ui/src/components/CodeMirror.tsx @@ -4,6 +4,7 @@ import type CodeMirror from 'codemirror'; import {autobind, changedEffect} from 'amis-core'; import {resizeSensor} from 'amis-core'; +import 'codemirror/theme/idea.css'; import 'codemirror/theme/base16-dark.css'; // import 'codemirror/theme/base16-light.css'; diff --git a/packages/amis-ui/src/components/formula/CodeEditor.tsx b/packages/amis-ui/src/components/formula/CodeEditor.tsx index af57a63e7..b963508fe 100644 --- a/packages/amis-ui/src/components/formula/CodeEditor.tsx +++ b/packages/amis-ui/src/components/formula/CodeEditor.tsx @@ -97,7 +97,7 @@ function CodeEditor(props: CodeEditorProps, ref: any) { (editorTheme ?? ((defaultTheme || '').includes('dark') ? 'dark' : 'light')) === 'dark' ? 'base16-dark' - : 'default'; + : 'idea'; let options: any = { autoFocus, indentUnit: 2, diff --git a/packages/amis-ui/src/components/formula/Input.tsx b/packages/amis-ui/src/components/formula/Input.tsx index 95a4570e6..bb255c264 100644 --- a/packages/amis-ui/src/components/formula/Input.tsx +++ b/packages/amis-ui/src/components/formula/Input.tsx @@ -15,7 +15,7 @@ import { import {FormulaEditor} from './Editor'; import ResultBox from '../ResultBox'; -import Select from '../Select'; +import {SelectWithRemoteOptions as Select} from '../Select'; import NumberInput from '../NumberInput'; import DatePicker from '../DatePicker'; import Tag from '../Tag'; @@ -91,7 +91,7 @@ const FormulaInput = (props: FormulaInputProps, ref: any) => { } = props; const schemaType = inputSettings.type; /** 自上层共享的属性 */ - const sharedProps = pick(props, ['disabled', 'clearable']); + const sharedProps = pick(props, ['disabled', 'clearable', 'data']); const pipInValue = useCallback( (value?: any) => { /** 数据来源可能是从 query中下发的(CRUD查询表头),导致数字或者布尔值被转为 string 格式,这里预处理一下 */ @@ -118,7 +118,7 @@ const FormulaInput = (props: FormulaInputProps, ref: any) => { result = origin.value; } else if (schemaType === 'select') { const { - joinValues, + joinValues = true, extractValue, delimiter, multiple, @@ -223,7 +223,7 @@ const FormulaInput = (props: FormulaInputProps, ref: any) => { } else if (!isExpr && (schemaType === 'select' || schemaType === 'boolean')) { return (