diff --git a/CHANGELOG.md b/CHANGELOG.md index 7af863d66e6616e84d76ae7c591fe5a5212fba04..e64a3a7805ac7268d5c180fa24fa71e8a445c7e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Added + +- 表单项提示框识别提示框信息绘制模式参数(tooltiprendermode),提示内容默认显示markdown格式 + ## [0.7.41-alpha.1] - 2025-06-06 ### Added diff --git a/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss b/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss index 51955c44c8794ce53f03906f9012e85800a58a71..1b527131e1dc648c9cc73c17ebbdb89d6e9f7b2d 100644 --- a/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss +++ b/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss @@ -80,6 +80,62 @@ $form-item-container: ( min-width: 50px; min-height: 20px; } + + // 适配提示框信息markdown绘制模式 + @include when('md') { + // 调整容器间距 + &.el-popper.el-popper { + padding: 0; + .#{bem('form-item-container__popper--content')} { + padding: 0; + } + } + .#{bem('markdown')} { + max-height: 100vh; + padding: 0 calc(#{getCssVar(spacing, extra-tight)} + #{getCssVar(spacing, extra-tight)}); + overflow: auto; + } + + .#{bem('form-item-container__popper--tooltip')}{ + padding: calc(#{getCssVar(spacing, extra-tight)} + #{getCssVar(spacing, extra-tight)}) 0; + } + + .#{bem('markdown-cherry')} { + width: auto !important; + } + + .cherry-previewer { + p:only-child { + margin: 0; + } + + &>p:first-child { + margin-top: 0; + } + } + + // 隐藏冗余元素 + .cherry-toolbar, + .cherry-toolbar-button, + .cherry-sidebar { + display: none; + } + + // 设置字体大小及行高 + .cherry { + font-size: inherit; + line-height: inherit; + } + + // 隐藏背景颜色及边框 + .cherry, + .cherry .cherry-previewer { + padding: 0; + background-color: transparent; + border: none !important; + box-shadow: none; + } + } } @include m((left, right)) { diff --git a/src/control/form/form-detail/form-item/form-item-container/form-item-container.tsx b/src/control/form/form-detail/form-item/form-item-container/form-item-container.tsx index dd290151f6886c5bbdd3190a0fcb7312c59e01ad..bf8113480a604e0b2891a879dbe6e97e47de1c49 100644 --- a/src/control/form/form-detail/form-item/form-item-container/form-item-container.tsx +++ b/src/control/form/form-detail/form-item/form-item-container/form-item-container.tsx @@ -27,12 +27,28 @@ export const IBizFormItemContainer = defineComponent({ onUnmounted(() => c.clearTipsCache()); + const renderTipContent = () => { + const { inputTip } = c.state; + switch (ibiz.config.tooltiprendermode) { + case 'none': + return {inputTip}; + case 'html': + return
; + case 'md': + default: + return