@kne/form-creator 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3313,7 +3313,8 @@ const pickFieldProps = (field, definition) => {
3313
3313
  return {
3314
3314
  inline: props.inline !== false,
3315
3315
  modern: !!props.modern,
3316
- block: !!props.block,
3316
+ // 编辑器用 choiceBlock,避免与字段布局 field.block(占满整行)同名冲突
3317
+ choiceBlock: !!props.block,
3317
3318
  indexType: props.indexType === 'number' || props.indexType === 'check' ? props.indexType : 'letter',
3318
3319
  otherLabel: ((_props$otherOption = props.otherOption) == null ? void 0 : _props$otherOption.label) || '',
3319
3320
  otherPlaceholder: ((_props$otherProps = props.otherProps) == null ? void 0 : _props$otherProps.placeholder) || ''
@@ -3326,7 +3327,7 @@ const pickFieldProps = (field, definition) => {
3326
3327
  }
3327
3328
  };
3328
3329
  const applyFieldProps = (props, values, definition) => {
3329
- var _values$rows, _definition$propsSche2;
3330
+ var _values$rows, _values$choiceBlock, _definition$propsSche2;
3330
3331
  const type = definition.type;
3331
3332
  switch (type) {
3332
3333
  case 'Input':
@@ -3396,7 +3397,8 @@ const applyFieldProps = (props, values, definition) => {
3396
3397
  // 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认横向
3397
3398
  props.inline = values.inline !== false;
3398
3399
  props.modern = !!values.modern;
3399
- props.block = !!values.block;
3400
+ // schema 仍写 props.block;编辑器表单字段名为 choiceBlock
3401
+ props.block = !!((_values$choiceBlock = values.choiceBlock) != null ? _values$choiceBlock : values.block);
3400
3402
  if (values.modern && (values.indexType === 'number' || values.indexType === 'check')) {
3401
3403
  props.indexType = values.indexType;
3402
3404
  } else {
@@ -6549,11 +6551,11 @@ const buildBuiltinList = (type, formatMessage) => {
6549
6551
  id: 'propChoiceModern'
6550
6552
  })
6551
6553
  }, "modern"), /*#__PURE__*/jsx(Checkbox, {
6552
- name: "block",
6554
+ name: "choiceBlock",
6553
6555
  children: formatMessage({
6554
6556
  id: 'propChoiceBlock'
6555
6557
  })
6556
- }, "block"), /*#__PURE__*/jsx(Select, {
6558
+ }, "choiceBlock"), /*#__PURE__*/jsx(Select, {
6557
6559
  name: "indexType",
6558
6560
  label: formatMessage({
6559
6561
  id: 'propChoiceIndexType'
@@ -8355,12 +8357,18 @@ const renderFieldEntries = (fields = [], preview = false, {
8355
8357
  }
8356
8358
  delete props.range;
8357
8359
 
8358
- // 选择组:form-creator 的 inline 仅编辑器用;渲染时删掉。block/modern 交给 react-form-antd;
8359
- // 未开 block 且 inline=false 时沿用旧纵向兜底
8360
+ // 选择组:inline 仅编辑器用;props.block(块级选项)经 isBlock 透传。
8361
+ // form-info / react-form-plus 会吃掉布局用 block,并把 isBlock remap 为控件 block。
8362
+ // 未开块级选项且 inline=false 时沿用旧纵向兜底。
8360
8363
  if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup' || field.type === 'RadioGroupOther' || field.type === 'CheckboxGroupOther') {
8361
8364
  const optionsInline = props.inline !== false;
8365
+ const choiceBlock = !!props.block;
8362
8366
  delete props.inline;
8363
- if (!props.block && !optionsInline) {
8367
+ delete props.block;
8368
+ if (choiceBlock) {
8369
+ props.isBlock = true;
8370
+ }
8371
+ if (!choiceBlock && !optionsInline) {
8364
8372
  if (field.type === 'RadioGroup' || field.type === 'RadioGroupOther') {
8365
8373
  props.vertical = true;
8366
8374
  }
@@ -8383,6 +8391,7 @@ const renderFieldEntries = (fields = [], preview = false, {
8383
8391
  labelRender: buildIndexedLabelRender(displayIndex)
8384
8392
  } : null, {
8385
8393
  rule: field.rule || undefined,
8394
+ // 仅布局「占满整行」;块级选项样式走上方 isBlock,避免被 form-plus 剥掉后失效
8386
8395
  block: field.block || undefined
8387
8396
  }, props, localeProps, {
8388
8397
  labelTips: buildLabelTips(field.tips),