Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2025-04-11 06:26:34 +00:00
commit 8c5edfc494
3 changed files with 6 additions and 3 deletions

View File

@ -257,8 +257,7 @@ export const SubTable: any = observer(
{field.editable && ( {field.editable && (
<Space <Space
style={{ style={{
marginTop: '10px', position: 'relative',
position: field.value?.length ? 'absolute' : 'relative',
bottom: '0', bottom: '0',
gap: 15, gap: 15,
}} }}

View File

@ -26,12 +26,13 @@ import { Json } from '../input';
const JT_VALUE_RE = /^\s*{{\s*([^{}]+)\s*}}\s*$/; const JT_VALUE_RE = /^\s*{{\s*([^{}]+)\s*}}\s*$/;
type ParseOptions = { type ParseOptions = {
defaultTypeOnNull?: string;
stringToDate?: boolean; stringToDate?: boolean;
}; };
function parseValue(value: any, options: ParseOptions = {}): string | string[] { function parseValue(value: any, options: ParseOptions = {}): string | string[] {
if (value == null) { if (value == null) {
return 'null'; return options.defaultTypeOnNull ?? 'null';
} }
const type = typeof value; const type = typeof value;
if (type === 'string') { if (type === 'string') {

View File

@ -57,6 +57,9 @@ export default class extends Instruction {
placeholder: `{{t("Duration", { ns: "${NAMESPACE}" })}}`, placeholder: `{{t("Duration", { ns: "${NAMESPACE}" })}}`,
useTypedConstant: [['number', { min: 1 }]], useTypedConstant: [['number', { min: 1 }]],
nullable: false, nullable: false,
parseOptions: {
defaultTypeOnNull: 'number',
},
}, },
default: 1, default: 1,
required: true, required: true,