@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.
package/dist/index.js CHANGED
@@ -3348,7 +3348,8 @@ const pickFieldProps = (field, definition) => {
3348
3348
  return {
3349
3349
  inline: props.inline !== false,
3350
3350
  modern: !!props.modern,
3351
- block: !!props.block,
3351
+ // 编辑器用 choiceBlock,避免与字段布局 field.block(占满整行)同名冲突
3352
+ choiceBlock: !!props.block,
3352
3353
  indexType: props.indexType === 'number' || props.indexType === 'check' ? props.indexType : 'letter',
3353
3354
  otherLabel: props.otherOption?.label || '',
3354
3355
  otherPlaceholder: props.otherProps?.placeholder || ''
@@ -3430,7 +3431,8 @@ const applyFieldProps = (props, values, definition) => {
3430
3431
  // 始终落盘布尔值,避免 Checkbox 未勾选时字段缺失被当成默认横向
3431
3432
  props.inline = values.inline !== false;
3432
3433
  props.modern = !!values.modern;
3433
- props.block = !!values.block;
3434
+ // schema 仍写 props.block;编辑器表单字段名为 choiceBlock
3435
+ props.block = !!(values.choiceBlock ?? values.block);
3434
3436
  if (values.modern && (values.indexType === 'number' || values.indexType === 'check')) {
3435
3437
  props.indexType = values.indexType;
3436
3438
  } else {
@@ -6576,11 +6578,11 @@ const buildBuiltinList = (type, formatMessage) => {
6576
6578
  id: 'propChoiceModern'
6577
6579
  })
6578
6580
  }, "modern"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Checkbox, {
6579
- name: "block",
6581
+ name: "choiceBlock",
6580
6582
  children: formatMessage({
6581
6583
  id: 'propChoiceBlock'
6582
6584
  })
6583
- }, "block"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Select, {
6585
+ }, "choiceBlock"), /*#__PURE__*/jsxRuntime.jsx(reactFormAntd.Select, {
6584
6586
  name: "indexType",
6585
6587
  label: formatMessage({
6586
6588
  id: 'propChoiceIndexType'
@@ -8395,12 +8397,18 @@ const renderFieldEntries = (fields = [], preview = false, {
8395
8397
  }
8396
8398
  delete props.range;
8397
8399
 
8398
- // 选择组:form-creator 的 inline 仅编辑器用;渲染时删掉。block/modern 交给 react-form-antd;
8399
- // 未开 block 且 inline=false 时沿用旧纵向兜底
8400
+ // 选择组:inline 仅编辑器用;props.block(块级选项)经 isBlock 透传。
8401
+ // form-info / react-form-plus 会吃掉布局用 block,并把 isBlock remap 为控件 block。
8402
+ // 未开块级选项且 inline=false 时沿用旧纵向兜底。
8400
8403
  if (field.type === 'RadioGroup' || field.type === 'CheckboxGroup' || field.type === 'RadioGroupOther' || field.type === 'CheckboxGroupOther') {
8401
8404
  const optionsInline = props.inline !== false;
8405
+ const choiceBlock = !!props.block;
8402
8406
  delete props.inline;
8403
- if (!props.block && !optionsInline) {
8407
+ delete props.block;
8408
+ if (choiceBlock) {
8409
+ props.isBlock = true;
8410
+ }
8411
+ if (!choiceBlock && !optionsInline) {
8404
8412
  if (field.type === 'RadioGroup' || field.type === 'RadioGroupOther') {
8405
8413
  props.vertical = true;
8406
8414
  }
@@ -8423,6 +8431,7 @@ const renderFieldEntries = (fields = [], preview = false, {
8423
8431
  labelRender: buildIndexedLabelRender(displayIndex)
8424
8432
  } : null),
8425
8433
  rule: field.rule || undefined,
8434
+ // 仅布局「占满整行」;块级选项样式走上方 isBlock,避免被 form-plus 剥掉后失效
8426
8435
  block: field.block || undefined,
8427
8436
  ...props,
8428
8437
  ...localeProps,