@kne/form-creator 0.1.16 → 0.1.17
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/README.md +124 -2
- package/dist/index.css +14 -13
- package/dist/index.css.map +1 -1
- package/dist/index.js +113 -148
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +21 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -5
package/dist/index.modern.js
CHANGED
|
@@ -4974,6 +4974,7 @@ const ChoiceBlock = ({
|
|
|
4974
4974
|
block,
|
|
4975
4975
|
preview: _preview = false,
|
|
4976
4976
|
isMobile: _isMobile = false,
|
|
4977
|
+
isPartRoot: _isPartRoot = false,
|
|
4977
4978
|
formatMessage,
|
|
4978
4979
|
renderOptionContent
|
|
4979
4980
|
}) => {
|
|
@@ -5119,7 +5120,7 @@ const ChoiceBlock = ({
|
|
|
5119
5120
|
title,
|
|
5120
5121
|
subtitle: modeHint,
|
|
5121
5122
|
bordered,
|
|
5122
|
-
className: style['choice-block'],
|
|
5123
|
+
className: [style['choice-block'], _isPartRoot ? InfoPage.partRootClassName : null].filter(Boolean).join(' '),
|
|
5123
5124
|
'data-choice-mode': mode
|
|
5124
5125
|
}, /*#__PURE__*/createElement('div', {
|
|
5125
5126
|
className: style['choice-selector']
|
|
@@ -5143,6 +5144,11 @@ const buildLabelTips = tips => {
|
|
|
5143
5144
|
className: style['field-label-tips-icon']
|
|
5144
5145
|
}));
|
|
5145
5146
|
};
|
|
5147
|
+
const resolvePartRootClassName = (depth, ...extra) => {
|
|
5148
|
+
// 顶层模块一律重设一级标题,嵌入外层 FormInfo Part 时不降为二级胶囊
|
|
5149
|
+
const names = [depth === 0 ? InfoPage.partRootClassName : null, ...extra].filter(Boolean);
|
|
5150
|
+
return names.length ? names.join(' ') : undefined;
|
|
5151
|
+
};
|
|
5146
5152
|
const renderFieldElements = (fields = [], preview = false, {
|
|
5147
5153
|
namePrefix
|
|
5148
5154
|
} = {}) => fields.filter(field => !field.hidden).map(field => {
|
|
@@ -5237,7 +5243,9 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5237
5243
|
gap: block.gap,
|
|
5238
5244
|
bordered,
|
|
5239
5245
|
list: [...fields, ...nested]
|
|
5240
|
-
}, listItemPartProps || {}
|
|
5246
|
+
}, listItemPartProps || {}, {
|
|
5247
|
+
className: resolvePartRootClassName(depth)
|
|
5248
|
+
})), asListItem);
|
|
5241
5249
|
}
|
|
5242
5250
|
case 'object':
|
|
5243
5251
|
{
|
|
@@ -5253,7 +5261,9 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5253
5261
|
gap: block.gap,
|
|
5254
5262
|
bordered,
|
|
5255
5263
|
list: [...fields, ...nested]
|
|
5256
|
-
}, listItemPartProps || {}
|
|
5264
|
+
}, listItemPartProps || {}, {
|
|
5265
|
+
className: resolvePartRootClassName(depth)
|
|
5266
|
+
})), asListItem);
|
|
5257
5267
|
}
|
|
5258
5268
|
case 'list':
|
|
5259
5269
|
{
|
|
@@ -5265,6 +5275,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5265
5275
|
title: block.title || undefined,
|
|
5266
5276
|
important: block.important || undefined,
|
|
5267
5277
|
bordered,
|
|
5278
|
+
className: resolvePartRootClassName(depth),
|
|
5268
5279
|
maxLength: block.maxLength,
|
|
5269
5280
|
minLength: block.minLength
|
|
5270
5281
|
}, block.addText ? {
|
|
@@ -5289,7 +5300,9 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5289
5300
|
addText: block.addText
|
|
5290
5301
|
} : {}, {
|
|
5291
5302
|
list: fields
|
|
5292
|
-
}, listItemPartProps || {}
|
|
5303
|
+
}, listItemPartProps || {}, {
|
|
5304
|
+
className: resolvePartRootClassName(depth)
|
|
5305
|
+
})), asListItem);
|
|
5293
5306
|
}
|
|
5294
5307
|
case 'multiField':
|
|
5295
5308
|
{
|
|
@@ -5314,6 +5327,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5314
5327
|
title: block.title || undefined,
|
|
5315
5328
|
subtitle: block.subtitle || undefined,
|
|
5316
5329
|
bordered,
|
|
5330
|
+
className: resolvePartRootClassName(depth),
|
|
5317
5331
|
prevIcon: /*#__PURE__*/createElement(ArrowLeftOutlined),
|
|
5318
5332
|
nextIcon: /*#__PURE__*/createElement(ArrowRightOutlined),
|
|
5319
5333
|
items: (block.items || []).map(step => {
|
|
@@ -5354,6 +5368,7 @@ const renderBlockElement = (block, preview = false, ctx = {}) => {
|
|
|
5354
5368
|
block,
|
|
5355
5369
|
preview,
|
|
5356
5370
|
isMobile,
|
|
5371
|
+
isPartRoot: depth === 0,
|
|
5357
5372
|
formatMessage,
|
|
5358
5373
|
renderOptionContent: option => {
|
|
5359
5374
|
const nodes = [];
|
|
@@ -6923,7 +6938,8 @@ const renderBlock = (block, data, ctx) => {
|
|
|
6923
6938
|
key: block.id,
|
|
6924
6939
|
title: block.title || block.label || undefined,
|
|
6925
6940
|
subtitle: block.subtitle || undefined,
|
|
6926
|
-
bordered
|
|
6941
|
+
bordered,
|
|
6942
|
+
className: depth === 0 ? InfoPage.partRootClassName : undefined
|
|
6927
6943
|
};
|
|
6928
6944
|
switch (block.kind) {
|
|
6929
6945
|
case 'formInfo':
|