fmui-base 2.3.74 → 2.3.75

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.75:移动端表单能支持自定义上下边距
6
7
  - 2.3.74:移动端流程办理支持流程办理人增加由所选活动指定办理人员
7
8
  - 2.3.73:移动端流程表单增加退回后重新提交前的批示意见在表单下方显示
8
9
  - 2.3.72:移动端表单设置自定义样式时图标乱码问题
package/lib/form/form.js CHANGED
@@ -601,8 +601,10 @@ var PageHome = function (_React$Component) {
601
601
  var formStyle = t.props.formStyle; //统一样式
602
602
  var subStyle = form.itemStyle; //每个样式
603
603
 
604
- var style = { contentStyle: {}, titleStyle: {} };
604
+ var style = { contentStyle: {}, titleStyle: {}, fieldPadding: 18 };
605
605
  if (formStyle != null && formStyle != '' && formStyle != undefined) {
606
+ // 表单级控件上下内边距(默认18,最大24)
607
+ style.fieldPadding = this.normalizeFieldPadding(formStyle.fieldPadding);
606
608
  if (formStyle.contentStyle != null && formStyle.contentStyle != '' && formStyle.contentStyle != undefined) {
607
609
  if (formStyle.contentStyle.color != null && formStyle.contentStyle.color != undefined) {
608
610
  style.contentStyle.color = formStyle.contentStyle.color;
@@ -2108,6 +2110,34 @@ var PageHome = function (_React$Component) {
2108
2110
  return !!(styleObj.fontFamily || styleObj.fontSize || styleObj.color || styleObj.fontWeight || styleObj.fontStyle);
2109
2111
  }
2110
2112
 
2113
+ /** 控件上下内边距:默认 18,最大 24 */
2114
+
2115
+ }, {
2116
+ key: 'normalizeFieldPadding',
2117
+ value: function normalizeFieldPadding(val) {
2118
+ var n = parseInt(val, 10);
2119
+ if (isNaN(n)) {
2120
+ n = 18;
2121
+ }
2122
+ if (n < 0) {
2123
+ n = 0;
2124
+ }
2125
+ if (n > 24) {
2126
+ n = 24;
2127
+ }
2128
+ return n;
2129
+ }
2130
+
2131
+ /** 覆盖标签/内容区上下内边距,左右 padding 保持原样式 */
2132
+
2133
+ }, {
2134
+ key: 'buildFieldPaddingCss',
2135
+ value: function buildFieldPaddingCss(scope, formStyleObj) {
2136
+ var padding = this.normalizeFieldPadding(formStyleObj && formStyleObj.fieldPadding);
2137
+ var px = padding + 'px';
2138
+ return [[scope + ' .t-field-layout-h-label', scope + ' .t-field-layout-v-label', scope + ' .t-field-layout-v-label-left'].join(',') + '{padding-top:' + px + ' !important;padding-bottom:' + px + ' !important;}', [scope + ' .t-field .t-field-layout-h-label+.t-field-multi', scope + ' .t-field-layout-h-label+.t-field-multi'].join(',') + '{padding-top:' + px + ' !important;padding-bottom:' + px + ' !important;}'].join('');
2139
+ }
2140
+
2111
2141
  // 组装 CSS 声明;important=true 用于压过 SaltUI 固定字号
2112
2142
  // options.skipFontFamily:避免字段字体覆盖 iconfont 图标
2113
2143
 
@@ -2172,6 +2202,7 @@ var PageHome = function (_React$Component) {
2172
2202
  var cssParts = [];
2173
2203
  var subColumnCount = parseInt(this.props.subColumnCount, 10);
2174
2204
  var isSubFormMultiCol = this.props.dataType === 'sub' && !isNaN(subColumnCount) && subColumnCount > 1;
2205
+ cssParts.push(this.buildFieldPaddingCss(scope, formStyleObj));
2175
2206
 
2176
2207
  if (this.hasFormStyleProps(ts)) {
2177
2208
  var labelCss = this.buildFormCssDecls(ts, { important: true, withLineHeight: true });
package/lib/form/table.js CHANGED
@@ -479,6 +479,34 @@ var PageHome = function (_React$Component) {
479
479
  }
480
480
  return !!(styleObj.fontFamily || styleObj.fontSize || styleObj.color || styleObj.fontWeight || styleObj.fontStyle);
481
481
  }
482
+
483
+ /** 控件上下内边距:默认 18,最大 24 */
484
+
485
+ }, {
486
+ key: 'normalizeFieldPadding',
487
+ value: function normalizeFieldPadding(val) {
488
+ var n = parseInt(val, 10);
489
+ if (isNaN(n)) {
490
+ n = 18;
491
+ }
492
+ if (n < 0) {
493
+ n = 0;
494
+ }
495
+ if (n > 24) {
496
+ n = 24;
497
+ }
498
+ return n;
499
+ }
500
+
501
+ /** 覆盖标签/内容区上下内边距,左右 padding 保持原样式 */
502
+
503
+ }, {
504
+ key: 'buildFieldPaddingCss',
505
+ value: function buildFieldPaddingCss(scope, formStyleObj) {
506
+ var padding = this.normalizeFieldPadding(formStyleObj && formStyleObj.fieldPadding);
507
+ var px = padding + 'px';
508
+ return [[scope + ' .t-field-layout-h-label', scope + ' .t-field-layout-v-label', scope + ' .t-field-layout-v-label-left'].join(',') + '{padding-top:' + px + ' !important;padding-bottom:' + px + ' !important;}', [scope + ' .t-field .t-field-layout-h-label+.t-field-multi', scope + ' .t-field-layout-h-label+.t-field-multi'].join(',') + '{padding-top:' + px + ' !important;padding-bottom:' + px + ' !important;}'].join('');
509
+ }
482
510
  }, {
483
511
  key: 'buildFormCssDecls',
484
512
  value: function buildFormCssDecls(styleObj, options) {
@@ -541,6 +569,7 @@ var PageHome = function (_React$Component) {
541
569
  var cs = formStyleObj.contentStyle || {};
542
570
  var scope = '.fmui-form-style-root';
543
571
  var cssParts = [];
572
+ cssParts.push(this.buildFieldPaddingCss(scope, formStyleObj));
544
573
  if (this.hasFormStyleProps(ts)) {
545
574
  var labelCss = this.buildFormCssDecls(ts, { important: true, withLineHeight: true });
546
575
  var fontSizeNum = parseInt(ts.fontSize, 10);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.74",
3
+ "version": "2.3.75",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",