fmui-base 2.3.71 → 2.3.72

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 CHANGED
@@ -3,6 +3,7 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.72:移动端表单设置自定义样式时图标乱码问题
6
7
  - 2.3.71:移动端办理列表缓急标签样式
7
8
  - 2.3.70:移动端支持表单的规则设置校验
8
9
  - 2.3.69:移动端批示意见字段落款支持表单上的自定义样式
package/lib/form/form.js CHANGED
@@ -2109,6 +2109,7 @@ var PageHome = function (_React$Component) {
2109
2109
  }
2110
2110
 
2111
2111
  // 组装 CSS 声明;important=true 用于压过 SaltUI 固定字号
2112
+ // options.skipFontFamily:避免字段字体覆盖 iconfont 图标
2112
2113
 
2113
2114
  }, {
2114
2115
  key: 'buildFormCssDecls',
@@ -2119,7 +2120,7 @@ var PageHome = function (_React$Component) {
2119
2120
  options = options || {};
2120
2121
  var important = options.important ? ' !important' : '';
2121
2122
  var parts = [];
2122
- if (styleObj.fontFamily) {
2123
+ if (!options.skipFontFamily && styleObj.fontFamily) {
2123
2124
  parts.push("font-family:'" + styleObj.fontFamily + "'" + important);
2124
2125
  }
2125
2126
  if (!options.skipColor && styleObj.color) {
@@ -2143,6 +2144,15 @@ var PageHome = function (_React$Component) {
2143
2144
  return parts.join(';');
2144
2145
  }
2145
2146
 
2147
+ // 字段样式注入后恢复图标字体,防止 font-family !important 导致 icon 乱码
2148
+
2149
+ }, {
2150
+ key: 'buildIconFontRestoreCss',
2151
+ value: function buildIconFontRestoreCss(scope) {
2152
+ var base = '{font-style:normal !important;font-weight:normal !important;}';
2153
+ return [[scope + ' .iconfont', scope + ' .iconfont:before', scope + ' .iconfont:after', scope + ' i.iconfont', scope + ' span.iconfont'].join(',') + '{font-family:"iconfont" !important;' + base.slice(1), [scope + ' .iconfont-ywtb', scope + ' .iconfont-ywtb:before', scope + ' .iconfont-ywtb:after'].join(',') + '{font-family:"iconfont-ywtb" !important;' + base.slice(1)].join('');
2154
+ }
2155
+
2146
2156
  // 字段名称+字段内容统一用 style 标签落地,避免各控件默认字号不一致、jQuery 被 React 冲掉
2147
2157
 
2148
2158
  }, {
@@ -2177,15 +2187,26 @@ var PageHome = function (_React$Component) {
2177
2187
  }
2178
2188
 
2179
2189
  if (this.hasFormStyleProps(cs)) {
2190
+ // 普通文本内容:完整字体样式
2180
2191
  var contentCss = this.buildFormCssDecls(cs, { important: true, withLineHeight: true });
2181
- cssParts.push([scope + ' .t-text-field-input', scope + ' .t-text-field-content-main', scope + ' .t-text-field-content-main span', scope + ' .t-field-content-box > .t-FB1', scope + ' .t-field-content-box > .t-FB1 span', scope + ' .t-field-multi', scope + ' .t-field-multi span', scope + ' .t-select-field-value', scope + ' .t-select-field-value span', scope + ' .t-radio-field-value', scope + ' .t-radio-field-value span', scope + ' .t-radio-field-value .t-FB1', scope + ' .t-radio-field-value .t-omit', scope + ' .t-datetime-field-value', scope + ' .t-datetime-field-value span', scope + ' .t-textarea-field-content', scope + ' .t-textarea-field-content textarea', scope + ' .t-checkbox-field-content', scope + ' .t-checkbox-field-label', scope + ' .t-checkbox-field-value-list', scope + ' .t-checkbox-field-value-list span', scope + ' .dd-select-input-option-text', scope + ' .t-popuser-value', scope + ' .t-popuser-value span', scope + ' .t-popuser-placeholder', scope + ' .t-poppage-value', scope + ' .t-poppage-value span', scope + ' .t-poppage-placeholder',
2192
+ // 含图标的选人/选页等:不写 font-family,避免盖住 iconfont
2193
+ var contentCssNoFont = this.buildFormCssDecls(cs, { important: true, withLineHeight: true, skipFontFamily: true });
2194
+ cssParts.push([scope + ' .t-text-field-input', scope + ' .t-text-field-content-main', scope + ' .t-text-field-content-main span:not(.iconfont)', scope + ' .t-field-content-box > .t-FB1', scope + ' .t-field-content-box > .t-FB1 span:not(.iconfont)', scope + ' .t-field-multi', scope + ' .t-field-multi span:not(.iconfont)', scope + ' .t-select-field-value', scope + ' .t-select-field-value span:not(.iconfont)', scope + ' .t-radio-field-value', scope + ' .t-radio-field-value span:not(.iconfont)', scope + ' .t-radio-field-value .t-FB1', scope + ' .t-radio-field-value .t-omit', scope + ' .t-datetime-field-value', scope + ' .t-datetime-field-value span:not(.iconfont)', scope + ' .t-textarea-field-content', scope + ' .t-textarea-field-content textarea', scope + ' .t-checkbox-field-content', scope + ' .t-checkbox-field-label', scope + ' .t-checkbox-field-value-list', scope + ' .t-checkbox-field-value-list span:not(.iconfont)', scope + ' .dd-select-input-option-text', scope + ' .t-popuser-placeholder', scope + ' .t-poppage-placeholder',
2182
2195
  // 月日自定义、意见、html 等非 SaltUI 标准内容节点
2183
2196
  scope + ' .t-FL', scope + ' .flex-comment .t-PT10', scope + ' .flex-comment .t-textarea-field-content',
2184
2197
  // 批示意见落款与内容字体颜色一致
2185
- scope + ' .comment-html', scope + ' .comment-html span', scope + ' .comment-content', scope + ' .ueditor-content', scope + ' .t-FB1.t-FAL', scope + ' .t-FB1.t-omit', scope + ' .t-omit', scope + ' .t-LH1_4', scope + ' .t-FS16', scope + ' .t-field-box.t-FS16', scope + ' .t-field-box.t-FS16 .t-FB1', scope + ' .section-content .t-FB1'].join(',') + '{' + contentCss + '}');
2198
+ scope + ' .comment-html', scope + ' .comment-html span:not(.iconfont)', scope + ' .comment-content', scope + ' .ueditor-content', scope + ' .t-FB1.t-FAL', scope + ' .t-FB1.t-omit', scope + ' .t-omit', scope + ' .t-LH1_4', scope + ' .t-FS16', scope + ' .t-field-box.t-FS16', scope + ' .t-field-box.t-FS16 .t-FB1', scope + ' .section-content .t-FB1'].join(',') + '{' + contentCss + '}');
2199
+
2200
+ // 选人/选页标签:只同步颜色字号,不改 font-family
2201
+ if (contentCssNoFont) {
2202
+ cssParts.push([scope + ' .t-popuser-value', scope + ' .t-popuser-value span:not(.iconfont)', scope + ' .t-poppage-value', scope + ' .t-poppage-value span:not(.iconfont)'].join(',') + '{' + contentCssNoFont + '}');
2203
+ }
2186
2204
 
2187
2205
  var placeholderCss = this.buildFormCssDecls(cs, { important: true, skipColor: true, withLineHeight: true });
2188
2206
  cssParts.push([scope + ' .t-text-field-placeholder', scope + ' .t-select-field-placeholder', scope + ' .t-datetime-field-placeholder', scope + ' .t-checkbox-field-placeholder'].join(',') + '{' + placeholderCss + '}');
2207
+
2208
+ // 兜底恢复图标字体
2209
+ cssParts.push(this.buildIconFontRestoreCss(scope));
2189
2210
  }
2190
2211
 
2191
2212
  var styleEl = document.getElementById(styleId);
package/lib/form/table.js CHANGED
@@ -488,7 +488,7 @@ var PageHome = function (_React$Component) {
488
488
  options = options || {};
489
489
  var important = options.important ? ' !important' : '';
490
490
  var parts = [];
491
- if (styleObj.fontFamily) {
491
+ if (!options.skipFontFamily && styleObj.fontFamily) {
492
492
  parts.push("font-family:'" + styleObj.fontFamily + "'" + important);
493
493
  }
494
494
  if (!options.skipColor && styleObj.color) {
@@ -512,6 +512,15 @@ var PageHome = function (_React$Component) {
512
512
  return parts.join(';');
513
513
  }
514
514
 
515
+ // 字段样式注入后恢复图标字体,防止 font-family !important 导致 icon 乱码
516
+
517
+ }, {
518
+ key: 'buildIconFontRestoreCss',
519
+ value: function buildIconFontRestoreCss(scope) {
520
+ var base = '{font-style:normal !important;font-weight:normal !important;}';
521
+ return [[scope + ' .iconfont', scope + ' .iconfont:before', scope + ' .iconfont:after', scope + ' i.iconfont', scope + ' span.iconfont'].join(',') + '{font-family:"iconfont" !important;' + base.slice(1), [scope + ' .iconfont-ywtb', scope + ' .iconfont-ywtb:before', scope + ' .iconfont-ywtb:after'].join(',') + '{font-family:"iconfont-ywtb" !important;' + base.slice(1)].join('');
522
+ }
523
+
515
524
  // 表单级统一样式:覆盖主表/子表/编辑/只读,避免依赖 fieldId class(UUID 数字开头选择器会失效)
516
525
 
517
526
  }, {
@@ -542,13 +551,19 @@ var PageHome = function (_React$Component) {
542
551
  }
543
552
  if (this.hasFormStyleProps(cs)) {
544
553
  var contentCss = this.buildFormCssDecls(cs, { important: true, withLineHeight: true });
545
- cssParts.push([scope + ' .t-text-field-input', scope + ' .t-text-field-content-main', scope + ' .t-text-field-content-main span', scope + ' .t-field-content-box > .t-FB1', scope + ' .t-field-content-box > .t-FB1 span', scope + ' .t-field-multi', scope + ' .t-field-multi span', scope + ' .t-select-field-value', scope + ' .t-select-field-value span', scope + ' .t-radio-field-value', scope + ' .t-radio-field-value span', scope + ' .t-radio-field-value .t-FB1', scope + ' .t-radio-field-value .t-omit', scope + ' .t-datetime-field-value', scope + ' .t-datetime-field-value span', scope + ' .t-textarea-field-content', scope + ' .t-textarea-field-content textarea', scope + ' .t-checkbox-field-content', scope + ' .t-checkbox-field-label', scope + ' .t-checkbox-field-value-list', scope + ' .t-checkbox-field-value-list span', scope + ' .dd-select-input-option-text', scope + ' .t-popuser-value', scope + ' .t-popuser-value span', scope + ' .t-popuser-placeholder', scope + ' .t-poppage-value', scope + ' .t-poppage-value span', scope + ' .t-poppage-placeholder', scope + ' .t-FL', scope + ' .flex-comment .t-textarea-field-content', scope + ' .flex-comment .t-PT10',
554
+ var contentCssNoFont = this.buildFormCssDecls(cs, { important: true, withLineHeight: true, skipFontFamily: true });
555
+ cssParts.push([scope + ' .t-text-field-input', scope + ' .t-text-field-content-main', scope + ' .t-text-field-content-main span:not(.iconfont)', scope + ' .t-field-content-box > .t-FB1', scope + ' .t-field-content-box > .t-FB1 span:not(.iconfont)', scope + ' .t-field-multi', scope + ' .t-field-multi span:not(.iconfont)', scope + ' .t-select-field-value', scope + ' .t-select-field-value span:not(.iconfont)', scope + ' .t-radio-field-value', scope + ' .t-radio-field-value span:not(.iconfont)', scope + ' .t-radio-field-value .t-FB1', scope + ' .t-radio-field-value .t-omit', scope + ' .t-datetime-field-value', scope + ' .t-datetime-field-value span:not(.iconfont)', scope + ' .t-textarea-field-content', scope + ' .t-textarea-field-content textarea', scope + ' .t-checkbox-field-content', scope + ' .t-checkbox-field-label', scope + ' .t-checkbox-field-value-list', scope + ' .t-checkbox-field-value-list span:not(.iconfont)', scope + ' .dd-select-input-option-text', scope + ' .t-popuser-placeholder', scope + ' .t-poppage-placeholder', scope + ' .t-FL', scope + ' .flex-comment .t-textarea-field-content', scope + ' .flex-comment .t-PT10',
546
556
  // 批示意见落款与内容字体颜色一致
547
- scope + ' .comment-html', scope + ' .comment-html span', scope + ' .comment-content', scope + ' .ueditor-content',
557
+ scope + ' .comment-html', scope + ' .comment-html span:not(.iconfont)', scope + ' .comment-content', scope + ' .ueditor-content',
548
558
  // 弹出选择/只读展示:常带 t-FS16 等工具类,需一并覆盖
549
559
  scope + ' .t-FB1.t-FAL', scope + ' .t-FB1.t-omit', scope + ' .t-omit', scope + ' .t-LH1_4', scope + ' .t-FS16', scope + ' .t-field-box.t-FS16', scope + ' .t-field-box.t-FS16 .t-FB1', scope + ' .section-content .t-FB1'].join(',') + '{' + contentCss + '}');
560
+ // 选人/选页标签:只同步颜色字号,不改 font-family
561
+ if (contentCssNoFont) {
562
+ cssParts.push([scope + ' .t-popuser-value', scope + ' .t-popuser-value span:not(.iconfont)', scope + ' .t-poppage-value', scope + ' .t-poppage-value span:not(.iconfont)'].join(',') + '{' + contentCssNoFont + '}');
563
+ }
550
564
  var placeholderCss = this.buildFormCssDecls(cs, { important: true, skipColor: true, withLineHeight: true });
551
565
  cssParts.push([scope + ' .t-text-field-placeholder', scope + ' .t-select-field-placeholder', scope + ' .t-datetime-field-placeholder', scope + ' .t-checkbox-field-placeholder'].join(',') + '{' + placeholderCss + '}');
566
+ cssParts.push(this.buildIconFontRestoreCss(scope));
552
567
  }
553
568
  if (!styleEl) {
554
569
  styleEl = document.createElement('style');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.71",
3
+ "version": "2.3.72",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",