resolver-egretimp-plus 0.0.158 → 0.0.160

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -92,6 +92,17 @@ export default {
92
92
  if (isPagePopup.value && isOnlyIconClickFlag.value) {
93
93
  delete ret.onClick
94
94
  }
95
+ if (ret.onWrapClick) {
96
+ if (ret.onClick) {
97
+ const originClick = ret.onClick
98
+ ret.onClick = function(...arg) {
99
+ originClick(...arg)
100
+ ret.onWrapClick(...arg)
101
+ }
102
+ } else {
103
+ ret.onClick = ret.onWrapClick
104
+ }
105
+ }
95
106
  return ret
96
107
  })
97
108
 
@@ -822,10 +822,33 @@ function getFormItemMargins(config) {
822
822
  return marginObj
823
823
  }
824
824
 
825
+ function normalLabelTipContent(content = '') {
826
+ if (content) {
827
+ const retList = []
828
+ const lines = content.split('\n')
829
+ lines.forEach((str, idx) => {
830
+ retList.push(str)
831
+ if (idx !== lines.length - 1) {
832
+ retList.push(
833
+ <br></br>
834
+ )
835
+ }
836
+ })
837
+ return retList
838
+ }
839
+ return ''
840
+ }
825
841
  function createFormLable(config, lang = 'zh') {
826
842
  const ElTooltip = resolveComponent('el-tooltip')
827
843
  const elIcon = resolveComponent('el-icon')
828
844
  const required = config.requiredFlag === '1'
845
+ const slots = {}
846
+ slots.default = () => {
847
+ return <span class="label-tip"><elIcon><QuestionFilled /></elIcon></span>
848
+ }
849
+ slots.content = () => {
850
+ return normalLabelTipContent(lang.indexOf('zh') > -1 ? config.hintContentZh : config.hintContentEn)
851
+ }
829
852
  return (
830
853
  <div title={lang.indexOf('zh') > -1 ? config.metaNameZh : config.metaNameEn} class="custom-label">
831
854
  <span class="custom-label-content" style={config.labelStyle}>
@@ -835,7 +858,7 @@ function createFormLable(config, lang = 'zh') {
835
858
  {
836
859
  config.hintFlag == '1' ? (
837
860
  <ElTooltip popper-class="poppper-class" effect="dark" content={lang.indexOf('zh') > -1 ? config.hintContentZh : config.hintContentEn} placement="top">
838
- <span class="label-tip"><elIcon><QuestionFilled /></elIcon></span>
861
+ { slots }
839
862
  </ElTooltip>
840
863
  ) : null
841
864
  }