easy3wui 1.5.8-6.beta → 1.5.8-7.beta

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.
@@ -92,23 +92,23 @@ var Easy3wCardM = function (_Component) {
92
92
  // 单个元素,检查是否是 Alert
93
93
  var _children = children,
94
94
  item = _children[0];
95
- var type = item.type;
95
+ var props = item.props;
96
+ var closable = props.closable,
97
+ message = props.message,
98
+ typeA = props.type;
96
99
 
97
- var _ref3 = type && type instanceof Object ? type : {},
98
- name = _ref3.name;
99
-
100
- if (name === 'Alert') {
100
+ if (closable && message && typeA === 'success') {
101
101
  children = null;
102
102
  }
103
103
  } else {
104
104
  // 多个元素,查找并移除 Alert
105
105
  var foundIndex = children.findIndex(function (item) {
106
- var type = item.type;
107
-
108
- var _ref4 = type && type instanceof Object ? type : {},
109
- name = _ref4.name;
106
+ var props = item.props;
107
+ var closable = props.closable,
108
+ message = props.message,
109
+ typeA = props.type;
110
110
 
111
- return name === 'Alert';
111
+ return closable && message && typeA === 'success';
112
112
  });
113
113
  if (foundIndex !== -1) {
114
114
  children.splice(foundIndex, 1);
@@ -125,10 +125,10 @@ var Easy3wCardM = function (_Component) {
125
125
  var hasReqFlag = false;
126
126
  if (label && label instanceof Object) {
127
127
  var _label = label,
128
- props = _label.props;
128
+ _props = _label.props;
129
129
 
130
- var _ref5 = props || {},
131
- childrenLabel = _ref5.children;
130
+ var _ref3 = _props || {},
131
+ childrenLabel = _ref3.children;
132
132
 
133
133
  if (childrenLabel && childrenLabel instanceof Array) {
134
134
  // 创建 childrenLabel 的可变副本,避免修改只读的 props.children
@@ -136,12 +136,12 @@ var Easy3wCardM = function (_Component) {
136
136
  var _foundIndex = childrenLabelCopy.findIndex(function (item) {
137
137
  var propsCL = item.props;
138
138
 
139
- var _ref6 = propsCL || {},
140
- childrenLabelC = _ref6.children,
141
- style = _ref6.style;
139
+ var _ref4 = propsCL || {},
140
+ childrenLabelC = _ref4.children,
141
+ style = _ref4.style;
142
142
 
143
- var _ref7 = style || {},
144
- color = _ref7.color;
143
+ var _ref5 = style || {},
144
+ color = _ref5.color;
145
145
  // const { name } = type && type instanceof Object ? type : {};
146
146
 
147
147
 
@@ -154,7 +154,7 @@ var Easy3wCardM = function (_Component) {
154
154
  // 移除红色星号元素
155
155
  childrenLabelCopy.splice(_foundIndex, 1);
156
156
  // 创建新的 label 元素,使用修改后的 children
157
- label = _react2['default'].cloneElement(label, (0, _extends3['default'])({}, props, {
157
+ label = _react2['default'].cloneElement(label, (0, _extends3['default'])({}, _props, {
158
158
  children: childrenLabelCopy.length === 1 ? childrenLabelCopy[0] : childrenLabelCopy
159
159
  }));
160
160
  }
@@ -91,23 +91,23 @@ var Easy3wCardPC = function (_Component) {
91
91
  // 单个元素,检查是否是 Alert
92
92
  var _children = children,
93
93
  item = _children[0];
94
- var type = item.type;
94
+ var props = item.props;
95
+ var closable = props.closable,
96
+ message = props.message,
97
+ typeA = props.type;
95
98
 
96
- var _ref3 = type && type instanceof Object ? type : {},
97
- name = _ref3.name;
98
-
99
- if (name === 'Alert') {
99
+ if (closable && message && typeA === 'success') {
100
100
  children = null;
101
101
  }
102
102
  } else {
103
103
  // 多个元素,查找并移除 Alert
104
104
  var foundIndex = children.findIndex(function (item) {
105
- var type = item.type;
106
-
107
- var _ref4 = type && type instanceof Object ? type : {},
108
- name = _ref4.name;
105
+ var props = item.props;
106
+ var closable = props.closable,
107
+ message = props.message,
108
+ typeA = props.type;
109
109
 
110
- return name === 'Alert';
110
+ return closable && message && typeA === 'success';
111
111
  });
112
112
  if (foundIndex !== -1) {
113
113
  children.splice(foundIndex, 1);
@@ -124,10 +124,10 @@ var Easy3wCardPC = function (_Component) {
124
124
  var hasReqFlag = false;
125
125
  if (label && label instanceof Object) {
126
126
  var _label = label,
127
- props = _label.props;
127
+ _props = _label.props;
128
128
 
129
- var _ref5 = props || {},
130
- childrenLabel = _ref5.children;
129
+ var _ref3 = _props || {},
130
+ childrenLabel = _ref3.children;
131
131
 
132
132
  if (childrenLabel && childrenLabel instanceof Array) {
133
133
  // 创建 childrenLabel 的可变副本,避免修改只读的 props.children
@@ -135,12 +135,12 @@ var Easy3wCardPC = function (_Component) {
135
135
  var _foundIndex = childrenLabelCopy.findIndex(function (item) {
136
136
  var propsCL = item.props;
137
137
 
138
- var _ref6 = propsCL || {},
139
- childrenLabelC = _ref6.children,
140
- style = _ref6.style;
138
+ var _ref4 = propsCL || {},
139
+ childrenLabelC = _ref4.children,
140
+ style = _ref4.style;
141
141
 
142
- var _ref7 = style || {},
143
- color = _ref7.color;
142
+ var _ref5 = style || {},
143
+ color = _ref5.color;
144
144
  // const { name } = type && type instanceof Object ? type : {};
145
145
 
146
146
 
@@ -153,7 +153,7 @@ var Easy3wCardPC = function (_Component) {
153
153
  // 移除红色星号元素
154
154
  childrenLabelCopy.splice(_foundIndex, 1);
155
155
  // 创建新的 label 元素,使用修改后的 children
156
- label = _react2['default'].cloneElement(label, (0, _extends3['default'])({}, props, {
156
+ label = _react2['default'].cloneElement(label, (0, _extends3['default'])({}, _props, {
157
157
  children: childrenLabelCopy.length === 1 ? childrenLabelCopy[0] : childrenLabelCopy
158
158
  }));
159
159
  }
@@ -195,6 +195,7 @@ var Easy3wCardPC = function (_Component) {
195
195
  bordered: false,
196
196
  className: (0, _classnames2['default'])(['e3wCardForm']),
197
197
  size: size || 'default'
198
+ // ref={this.myRef}
198
199
  },
199
200
  cardHelpInfo ? _react2['default'].createElement(_alert2['default'], {
200
201
  message: cardHelpInfo,
@@ -205,6 +206,29 @@ var Easy3wCardPC = function (_Component) {
205
206
  );
206
207
  }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
207
208
  }
209
+ // constructor(props) {
210
+ // super(props);
211
+ // this.myRef = this.createRef();
212
+ // }
213
+
214
+ // componentDidUpdate() {
215
+ // // 使用 findDOMNode 获取 Card 组件的 DOM 节点
216
+ // // eslint-disable-next-line react/no-find-dom-node
217
+ // const cardNode = ReactDOM.findDOMNode(this.myRef.current);
218
+ // if (cardNode) {
219
+ // // 查找 Card 内部的 antd Alert 元素
220
+ // const alertElements = cardNode.querySelectorAll('.ant-card-body>.ant-alert');
221
+ // console.log('alertElements', alertElements);
222
+ // // 遍历并移除所有 Alert 元素
223
+ // // alertElements.forEach((alertElement) => {
224
+ // // if (alertElement.parentNode) {
225
+ // // console.log('alertElement.parentNode.removeChild', alertElement.parentNode.removeChild);
226
+ // // alertElement.parentNode.removeChild(alertElement);
227
+ // // }
228
+ // // });
229
+ // }
230
+ // }
231
+
208
232
  // 根据配置重新渲染 去除原内容: 如帮助及红色*号
209
233
 
210
234
 
@@ -1098,18 +1098,15 @@ var _initialiseProps = function _initialiseProps() {
1098
1098
  var needHelpFlag = true;
1099
1099
  if (titlec && titlec instanceof Object) {
1100
1100
  var _titlec = titlec,
1101
- titleType = _titlec.type,
1102
1101
  props = _titlec.props;
1103
1102
 
1104
- var _ref3 = titleType || {},
1105
- name = _ref3.name;
1103
+ var _ref3 = props || {},
1104
+ placement = _ref3.placement,
1105
+ titleT = _ref3.title,
1106
+ children = _ref3.children,
1107
+ restProps = (0, _objectWithoutProperties3['default'])(_ref3, ['placement', 'title', 'children']);
1106
1108
 
1107
- var _ref4 = props || {},
1108
- titleT = _ref4.title,
1109
- children = _ref4.children,
1110
- restProps = (0, _objectWithoutProperties3['default'])(_ref4, ['title', 'children']);
1111
-
1112
- if (name === 'Tooltip' && titleT) {
1109
+ if (placement && titleT && children) {
1113
1110
  // 创建新的Tooltip组件,继承现有props,更新title
1114
1111
  titlec = _react2['default'].createElement(
1115
1112
  _tooltip2['default'],
@@ -1218,8 +1215,8 @@ var _initialiseProps = function _initialiseProps() {
1218
1215
  this.saveEditBigTableZJ = function () {
1219
1216
  var objToolbarProps = _this3.props.objToolbarProps;
1220
1217
 
1221
- var _ref5 = objToolbarProps || {},
1222
- saveEditBigTable = _ref5.saveEditBigTable;
1218
+ var _ref4 = objToolbarProps || {},
1219
+ saveEditBigTable = _ref4.saveEditBigTable;
1223
1220
 
1224
1221
  if (saveEditBigTable && typeof saveEditBigTable === 'function') {
1225
1222
  // 数据变更-回调函数
@@ -483,18 +483,15 @@ var Easy3wFormPageM = exports.Easy3wFormPageM = function (_Component) {
483
483
  var needHelpFlag = true;
484
484
  if (label && label instanceof Object) {
485
485
  var _label = label,
486
- type = _label.type,
487
486
  props = _label.props;
488
487
 
489
- var _ref = type || {},
490
- name = _ref.name;
488
+ var _ref = props || {},
489
+ placement = _ref.placement,
490
+ title = _ref.title,
491
+ children = _ref.children,
492
+ restProps = (0, _objectWithoutProperties3['default'])(_ref, ['placement', 'title', 'children']);
491
493
 
492
- var _ref2 = props || {},
493
- title = _ref2.title,
494
- children = _ref2.children,
495
- restProps = (0, _objectWithoutProperties3['default'])(_ref2, ['title', 'children']);
496
-
497
- if (name === 'Tooltip' && title) {
494
+ if (placement && title && children) {
498
495
  // 创建新的Tooltip组件,继承现有props,更新title
499
496
  label = _react2['default'].createElement(
500
497
  _tooltip2['default'],
@@ -753,14 +750,14 @@ var Easy3wFormPageM = exports.Easy3wFormPageM = function (_Component) {
753
750
  disableFlag = item.disableFlag,
754
751
  numberFormat = item.numberFormat;
755
752
 
756
- var _ref3 = globalData || {},
757
- dataDesensitizationEyeFlag = _ref3.dataDesensitizationEyeFlag;
753
+ var _ref2 = globalData || {},
754
+ dataDesensitizationEyeFlag = _ref2.dataDesensitizationEyeFlag;
758
755
 
759
756
  var value = item.value;
760
757
 
761
- var _ref4 = cmptPros || {},
762
- addonAfter = _ref4.addonAfter,
763
- numeralFormat = _ref4.numeralFormat;
758
+ var _ref3 = cmptPros || {},
759
+ addonAfter = _ref3.addonAfter,
760
+ numeralFormat = _ref3.numeralFormat;
764
761
  // numeralFormat 新组件(金额、数字)的格式化参数
765
762
 
766
763
 
@@ -1349,18 +1346,18 @@ var Easy3wFormPageM = exports.Easy3wFormPageM = function (_Component) {
1349
1346
 
1350
1347
  var threeRowItemFlag = false;
1351
1348
  for (var _iterator = rowItemsF, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
1352
- var _ref5;
1349
+ var _ref4;
1353
1350
 
1354
1351
  if (_isArray) {
1355
1352
  if (_i >= _iterator.length) break;
1356
- _ref5 = _iterator[_i++];
1353
+ _ref4 = _iterator[_i++];
1357
1354
  } else {
1358
1355
  _i = _iterator.next();
1359
1356
  if (_i.done) break;
1360
- _ref5 = _i.value;
1357
+ _ref4 = _i.value;
1361
1358
  }
1362
1359
 
1363
- var rItem = _ref5;
1360
+ var rItem = _ref4;
1364
1361
 
1365
1362
  if (rItem.cols.length === 3) {
1366
1363
  threeRowItemFlag = true;
@@ -3262,18 +3259,18 @@ var Easy3wFormPageTightM = exports.Easy3wFormPageTightM = function (_Component2)
3262
3259
  rowItems = _this2.touchTransformRowItems(rowItems);
3263
3260
  var threeRowItemFlag = false;
3264
3261
  for (var _iterator2 = rowItems, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
3265
- var _ref6;
3262
+ var _ref5;
3266
3263
 
3267
3264
  if (_isArray2) {
3268
3265
  if (_i3 >= _iterator2.length) break;
3269
- _ref6 = _iterator2[_i3++];
3266
+ _ref5 = _iterator2[_i3++];
3270
3267
  } else {
3271
3268
  _i3 = _iterator2.next();
3272
3269
  if (_i3.done) break;
3273
- _ref6 = _i3.value;
3270
+ _ref5 = _i3.value;
3274
3271
  }
3275
3272
 
3276
- var rItem = _ref6;
3273
+ var rItem = _ref5;
3277
3274
 
3278
3275
  if (rItem.cols.length === 3) {
3279
3276
  threeRowItemFlag = true;
@@ -474,18 +474,16 @@ var Easy3wFormPagePC = exports.Easy3wFormPagePC = function (_Component) {
474
474
  var needHelpFlag = true;
475
475
  if (label && label instanceof Object) {
476
476
  var _label = label,
477
- type = _label.type,
478
477
  props = _label.props;
478
+ // const { name } = type || {};
479
479
 
480
- var _ref = type || {},
481
- name = _ref.name;
480
+ var _ref = props || {},
481
+ placement = _ref.placement,
482
+ title = _ref.title,
483
+ children = _ref.children,
484
+ restProps = (0, _objectWithoutProperties3['default'])(_ref, ['placement', 'title', 'children']);
482
485
 
483
- var _ref2 = props || {},
484
- title = _ref2.title,
485
- children = _ref2.children,
486
- restProps = (0, _objectWithoutProperties3['default'])(_ref2, ['title', 'children']);
487
-
488
- if (name === 'Tooltip' && title) {
486
+ if (placement && title && children) {
489
487
  // 创建新的Tooltip组件,继承现有props,更新title
490
488
  label = _react2['default'].createElement(
491
489
  _tooltip2['default'],
@@ -637,14 +635,14 @@ var Easy3wFormPagePC = exports.Easy3wFormPagePC = function (_Component) {
637
635
  disableFlag = item.disableFlag,
638
636
  numberFormat = item.numberFormat;
639
637
 
640
- var _ref3 = globalData || {},
641
- dataDesensitizationEyeFlag = _ref3.dataDesensitizationEyeFlag;
638
+ var _ref2 = globalData || {},
639
+ dataDesensitizationEyeFlag = _ref2.dataDesensitizationEyeFlag;
642
640
 
643
641
  var value = item.value;
644
642
 
645
- var _ref4 = cmptPros || {},
646
- addonAfter = _ref4.addonAfter,
647
- numeralFormat = _ref4.numeralFormat;
643
+ var _ref3 = cmptPros || {},
644
+ addonAfter = _ref3.addonAfter,
645
+ numeralFormat = _ref3.numeralFormat;
648
646
  // numeralFormat 新组件(金额、数字)的格式化参数
649
647
 
650
648
 
@@ -1230,18 +1228,18 @@ var Easy3wFormPagePC = exports.Easy3wFormPagePC = function (_Component) {
1230
1228
 
1231
1229
  var threeRowItemFlag = false;
1232
1230
  for (var _iterator = rowItemsF, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
1233
- var _ref5;
1231
+ var _ref4;
1234
1232
 
1235
1233
  if (_isArray) {
1236
1234
  if (_i >= _iterator.length) break;
1237
- _ref5 = _iterator[_i++];
1235
+ _ref4 = _iterator[_i++];
1238
1236
  } else {
1239
1237
  _i = _iterator.next();
1240
1238
  if (_i.done) break;
1241
- _ref5 = _i.value;
1239
+ _ref4 = _i.value;
1242
1240
  }
1243
1241
 
1244
- var rItem = _ref5;
1242
+ var rItem = _ref4;
1245
1243
 
1246
1244
  if (rItem.cols.length === 3) {
1247
1245
  threeRowItemFlag = true;
@@ -2997,18 +2995,18 @@ var Easy3wFormPageTightPC = exports.Easy3wFormPageTightPC = function (_Component
2997
2995
 
2998
2996
  var threeRowItemFlag = false;
2999
2997
  for (var _iterator2 = rowItems, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
3000
- var _ref6;
2998
+ var _ref5;
3001
2999
 
3002
3000
  if (_isArray2) {
3003
3001
  if (_i3 >= _iterator2.length) break;
3004
- _ref6 = _iterator2[_i3++];
3002
+ _ref5 = _iterator2[_i3++];
3005
3003
  } else {
3006
3004
  _i3 = _iterator2.next();
3007
3005
  if (_i3.done) break;
3008
- _ref6 = _i3.value;
3006
+ _ref5 = _i3.value;
3009
3007
  }
3010
3008
 
3011
- var rItem = _ref6;
3009
+ var rItem = _ref5;
3012
3010
 
3013
3011
  if (rItem.cols.length === 3) {
3014
3012
  threeRowItemFlag = true;
@@ -785,18 +785,15 @@ var _initialiseProps = function _initialiseProps() {
785
785
  var needHelpFlag = true;
786
786
  if (title && title instanceof Object) {
787
787
  var _title = title,
788
- type = _title.type,
789
788
  props = _title.props;
790
789
 
791
- var _ref2 = type || {},
792
- name = _ref2.name;
790
+ var _ref2 = props || {},
791
+ placement = _ref2.placement,
792
+ titleT = _ref2.title,
793
+ children = _ref2.children,
794
+ restProps = (0, _objectWithoutProperties3['default'])(_ref2, ['placement', 'title', 'children']);
793
795
 
794
- var _ref3 = props || {},
795
- titleT = _ref3.title,
796
- children = _ref3.children,
797
- restProps = (0, _objectWithoutProperties3['default'])(_ref3, ['title', 'children']);
798
-
799
- if (name === 'Tooltip' && titleT) {
796
+ if (placement && titleT && children) {
800
797
  // 创建新的Tooltip组件,继承现有props,更新title
801
798
  title = _react2['default'].createElement(
802
799
  _tooltip2['default'],
@@ -758,18 +758,15 @@ var _initialiseProps = function _initialiseProps() {
758
758
  var needHelpFlag = true;
759
759
  if (title && title instanceof Object) {
760
760
  var _title = title,
761
- type = _title.type,
762
761
  props = _title.props;
763
762
 
764
- var _ref2 = type || {},
765
- name = _ref2.name;
763
+ var _ref2 = props || {},
764
+ placement = _ref2.placement,
765
+ titleT = _ref2.title,
766
+ children = _ref2.children,
767
+ restProps = (0, _objectWithoutProperties3['default'])(_ref2, ['placement', 'title', 'children']);
766
768
 
767
- var _ref3 = props || {},
768
- titleT = _ref3.title,
769
- children = _ref3.children,
770
- restProps = (0, _objectWithoutProperties3['default'])(_ref3, ['title', 'children']);
771
-
772
- if (name === 'Tooltip' && titleT) {
769
+ if (placement && titleT && children) {
773
770
  // 创建新的Tooltip组件,继承现有props,更新title
774
771
  title = _react2['default'].createElement(
775
772
  _tooltip2['default'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.86.beta",
3
+ "version": "1.5.87.beta",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",