cloud-b2b 1.1.7 → 1.1.8

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.
@@ -166,9 +166,9 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
166
166
  if (!invalid) {
167
167
  onChange && onChange(value);
168
168
  }
169
- }
170
169
 
171
- onBlur && onBlur(event);
170
+ onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
171
+ }
172
172
  });
173
173
 
174
174
  _defineProperty(_assertThisInitialized(_this), "hasSpecialChar", function (value) {
@@ -133,7 +133,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
133
133
  * checkable:是否显示checkbox选择框
134
134
  * onOpenChange:控制日期框显示隐藏回调func(key, open)
135
135
  * onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
136
- * OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
136
+ * onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
137
137
  */
138
138
 
139
139
 
@@ -90,7 +90,8 @@ var ColType = {
90
90
  /**
91
91
  * onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
92
92
  * onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
93
- * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value)
93
+ * onBlur: 输入框失去焦点时触发,原型为function(rowIndex, keyName, value)
94
+ * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value, col)
94
95
  * onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
95
96
  * onAdd:点击+号时触发,原型为function(keyName)
96
97
  * onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
@@ -101,6 +102,7 @@ var CallbackType = {
101
102
  onExitValid: PropTypes.func,
102
103
  onCheck: PropTypes.func,
103
104
  onContentChange: PropTypes.func,
105
+ onBlur: PropTypes.func,
104
106
  onSearch: PropTypes.func,
105
107
  onLink: PropTypes.func,
106
108
  onAdd: PropTypes.func,
@@ -186,8 +188,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
186
188
  };
187
189
  });
188
190
 
189
- _defineProperty(_assertThisInitialized(_this), "onBlur", function () {
190
- _this.closeValid();
191
+ _defineProperty(_assertThisInitialized(_this), "onBlur", function (key, rowIndex) {
192
+ return function (value) {
193
+ var _ref7 = _this.props.callback || {},
194
+ onBlur = _ref7.onBlur;
195
+
196
+ _this.closeValid();
197
+
198
+ onBlur && onBlur(_this.getIndex(rowIndex), key, value);
199
+ };
191
200
  });
192
201
 
193
202
  _defineProperty(_assertThisInitialized(_this), "closeValid", function () {
@@ -249,7 +258,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
249
258
  options: _this.getOptions(key, options, index),
250
259
  onChange: _this.onChange(key, index),
251
260
  onSearch: _this.onSearch(key, index, config),
252
- onBlur: _this.onBlur
261
+ onBlur: _this.onBlur(key, index)
253
262
  };
254
263
 
255
264
  if (showRowAdd && _Array$isArray(isRequired) && _includesInstanceProperty(isRequired).call(isRequired, key)) {
@@ -329,8 +338,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
329
338
  var split = index2 === list.length - 1 ? '' : ',';
330
339
 
331
340
  var onClick = function onClick() {
332
- var _ref7 = _this.props.callback || {},
333
- onLink = _ref7.onLink;
341
+ var _ref8 = _this.props.callback || {},
342
+ onLink = _ref8.onLink;
334
343
 
335
344
  onLink && onLink(col.key, index, item2);
336
345
  };
@@ -344,8 +353,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
344
353
  var title = typeof col.link === 'string' ? col.link : value;
345
354
 
346
355
  var onClick = function onClick() {
347
- var _ref8 = _this.props.callback || {},
348
- onLink = _ref8.onLink;
356
+ var _ref9 = _this.props.callback || {},
357
+ onLink = _ref9.onLink;
349
358
 
350
359
  onLink && onLink(col.key, index, record);
351
360
  };
@@ -500,12 +509,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
500
509
  }
501
510
  });
502
511
 
503
- _defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref9) {
504
- var required = _ref9.required,
505
- title = _ref9.title,
506
- type = _ref9.type,
507
- key = _ref9.key,
508
- showAdd = _ref9.showAdd;
512
+ _defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref10) {
513
+ var required = _ref10.required,
514
+ title = _ref10.title,
515
+ type = _ref10.type,
516
+ key = _ref10.key,
517
+ showAdd = _ref10.showAdd;
509
518
 
510
519
  if (type === 'checkbox') {
511
520
  var status = _this.getCheckedStatus(key);
@@ -521,9 +530,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
521
530
  }
522
531
  });
523
532
 
524
- _defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref10) {
525
- var type = _ref10.type,
526
- align = _ref10.align;
533
+ _defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref11) {
534
+ var type = _ref11.type,
535
+ align = _ref11.align;
527
536
 
528
537
  if (type === 'index' || type === 'checkbox') {
529
538
  return 'ant-table-selection-column';
@@ -544,8 +553,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
544
553
  var readonly = _this.props.readonly;
545
554
  return _mapInstanceProperty(_context8 = _filterInstanceProperty(cols).call(cols, function (col) {
546
555
  return !col.hide;
547
- })).call(_context8, function (_ref11, index) {
548
- var col = _extends({}, _ref11);
556
+ })).call(_context8, function (_ref12, index) {
557
+ var col = _extends({}, _ref12);
549
558
 
550
559
  col.className = _this.getColumnClassName(col);
551
560
  col.title = _this.getColumnTitle(col);
@@ -571,12 +580,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
571
580
 
572
581
  _defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
573
582
  return _mapInstanceProperty(items).call(items, function (item, index) {
574
- return _reduceInstanceProperty(cols).call(cols, function (result, _ref12) {
583
+ return _reduceInstanceProperty(cols).call(cols, function (result, _ref13) {
575
584
  var _context9;
576
585
 
577
- var key = _ref12.key,
578
- type = _ref12.type,
579
- options = _ref12.options;
586
+ var key = _ref13.key,
587
+ type = _ref13.type,
588
+ options = _ref13.options;
580
589
 
581
590
  if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context9 = item.isReadonly).call(_context9, key))) {
582
591
  result[key] = item[key];
@@ -1,35 +1,35 @@
1
- @import '../variables';
2
-
3
- .@{cloudlink-prefix}-title {
4
- > *:first-child {
5
- display: inline-block;
6
- color: @brand-primary;
7
- line-height: 1.2;
8
-
9
- &[data-border='true'] {
10
- padding: 0 5px;
11
- border-left: @brand-primary solid 3px;
12
- }
13
-
14
- &[data-fold='true'] {
15
- cursor: pointer;
16
- margin: 8px 0;
17
- }
18
-
19
- &[data-required='true'] {
20
- &::after {
21
- display: inline-block;
22
- margin-left: 4px;
23
- color: #f5222d;
24
- font-size: 12px;
25
- font-family: SimSun, sans-serif;
26
- line-height: 1;
27
- content: '*';
28
- }
29
- }
30
- }
31
-
32
- > [role = 'toolbar'] {
33
- display: inline-block;
34
- }
35
- }
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-title {
4
+ > *:first-child {
5
+ display: inline-block;
6
+ color: @brand-primary;
7
+ line-height: 1.2;
8
+
9
+ &[data-border='true'] {
10
+ padding: 0 5px;
11
+ border-left: @brand-primary solid 3px;
12
+ }
13
+
14
+ &[data-fold='true'] {
15
+ cursor: pointer;
16
+ margin: 8px 0;
17
+ }
18
+
19
+ &[data-required='true'] {
20
+ &::after {
21
+ display: inline-block;
22
+ margin-left: 4px;
23
+ color: #f5222d;
24
+ font-size: 12px;
25
+ font-family: SimSun, sans-serif;
26
+ line-height: 1;
27
+ content: '*';
28
+ }
29
+ }
30
+ }
31
+
32
+ > [role = 'toolbar'] {
33
+ display: inline-block;
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "name": "Title",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./Title.js"
6
- }
1
+ {
2
+ "name": "Title",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Title.js"
6
+ }
@@ -194,9 +194,9 @@ var NumberInput = /*#__PURE__*/function (_React$Component) {
194
194
  if (!invalid) {
195
195
  onChange && onChange(value);
196
196
  }
197
- }
198
197
 
199
- onBlur && onBlur(event);
198
+ onBlur && onBlur(event); //有输入才触发外部失去焦点事件,避免非必要请求
199
+ }
200
200
  });
201
201
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "hasSpecialChar", function (value) {
202
202
  if ((0, _includes["default"])(value).call(value, '+')) {
@@ -183,7 +183,7 @@ var Controlled = /*#__PURE__*/function (_React$Component) {
183
183
  * checkable:是否显示checkbox选择框
184
184
  * onOpenChange:控制日期框显示隐藏回调func(key, open)
185
185
  * onAreaSearch:联级选择器触发,原型为func(key - 当前联级key, title - 输入值, parentKey - 主体联级key)
186
- * OnFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
186
+ * onFileChange:上传组件触发,原型为func(key,{fileList, fileDeleteList})
187
187
  */
188
188
 
189
189
 
@@ -144,7 +144,8 @@ var ColType = {
144
144
  /**
145
145
  * onCheck:点击复选框时触发,原型func(rowIndex, keyName, checked)
146
146
  * onContentChange: 输入框内容改变时触发,原型为function(rowIndex, keyName, value)
147
- * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value)
147
+ * onBlur: 输入框失去焦点时触发,原型为function(rowIndex, keyName, value)
148
+ * onSearch:search组件输入内容时触发,原型为function(rowIndex, keyName, value, col)
148
149
  * onLink: 点击超链接时触发,原型为function(keyName, rowIndex, item)
149
150
  * onAdd:点击+号时触发,原型为function(keyName)
150
151
  * onRenderCustom:(废弃)用于渲染type为custom类型的单元格,原型为function(rowIndex, keyName, value,props)
@@ -155,6 +156,7 @@ var CallbackType = {
155
156
  onExitValid: _propTypes["default"].func,
156
157
  onCheck: _propTypes["default"].func,
157
158
  onContentChange: _propTypes["default"].func,
159
+ onBlur: _propTypes["default"].func,
158
160
  onSearch: _propTypes["default"].func,
159
161
  onLink: _propTypes["default"].func,
160
162
  onAdd: _propTypes["default"].func,
@@ -233,8 +235,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
233
235
  onLink && onLink(key, index, _this.props.items[index]);
234
236
  };
235
237
  });
236
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function () {
237
- _this.closeValid();
238
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
239
+ return function (value) {
240
+ var _ref7 = _this.props.callback || {},
241
+ onBlur = _ref7.onBlur;
242
+
243
+ _this.closeValid();
244
+
245
+ onBlur && onBlur(_this.getIndex(rowIndex), key, value);
246
+ };
238
247
  });
239
248
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
240
249
  var _this$props = _this.props,
@@ -292,7 +301,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
292
301
  options: _this.getOptions(key, options, index),
293
302
  onChange: _this.onChange(key, index),
294
303
  onSearch: _this.onSearch(key, index, config),
295
- onBlur: _this.onBlur
304
+ onBlur: _this.onBlur(key, index)
296
305
  };
297
306
 
298
307
  if (showRowAdd && (0, _isArray["default"])(isRequired) && (0, _includes["default"])(isRequired).call(isRequired, key)) {
@@ -371,8 +380,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
371
380
  var split = index2 === list.length - 1 ? '' : ',';
372
381
 
373
382
  var onClick = function onClick() {
374
- var _ref7 = _this.props.callback || {},
375
- onLink = _ref7.onLink;
383
+ var _ref8 = _this.props.callback || {},
384
+ onLink = _ref8.onLink;
376
385
 
377
386
  onLink && onLink(col.key, index, item2);
378
387
  };
@@ -386,8 +395,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
386
395
  var title = typeof col.link === 'string' ? col.link : value;
387
396
 
388
397
  var onClick = function onClick() {
389
- var _ref8 = _this.props.callback || {},
390
- onLink = _ref8.onLink;
398
+ var _ref9 = _this.props.callback || {},
399
+ onLink = _ref9.onLink;
391
400
 
392
401
  onLink && onLink(col.key, index, record);
393
402
  };
@@ -537,12 +546,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
537
546
  return null;
538
547
  }
539
548
  });
540
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref9) {
541
- var required = _ref9.required,
542
- title = _ref9.title,
543
- type = _ref9.type,
544
- key = _ref9.key,
545
- showAdd = _ref9.showAdd;
549
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref10) {
550
+ var required = _ref10.required,
551
+ title = _ref10.title,
552
+ type = _ref10.type,
553
+ key = _ref10.key,
554
+ showAdd = _ref10.showAdd;
546
555
 
547
556
  if (type === 'checkbox') {
548
557
  var status = _this.getCheckedStatus(key);
@@ -557,9 +566,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
557
566
  }, title, _this.toAdd(key, showAdd));
558
567
  }
559
568
  });
560
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref10) {
561
- var type = _ref10.type,
562
- align = _ref10.align;
569
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref11) {
570
+ var type = _ref11.type,
571
+ align = _ref11.align;
563
572
 
564
573
  if (type === 'index' || type === 'checkbox') {
565
574
  return 'ant-table-selection-column';
@@ -578,8 +587,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
578
587
  var readonly = _this.props.readonly;
579
588
  return (0, _map["default"])(_context8 = (0, _filter["default"])(cols).call(cols, function (col) {
580
589
  return !col.hide;
581
- })).call(_context8, function (_ref11, index) {
582
- var col = (0, _extends2["default"])({}, _ref11);
590
+ })).call(_context8, function (_ref12, index) {
591
+ var col = (0, _extends2["default"])({}, _ref12);
583
592
  col.className = _this.getColumnClassName(col);
584
593
  col.title = _this.getColumnTitle(col);
585
594
  col.dataIndex = col.key;
@@ -603,12 +612,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
603
612
  });
604
613
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
605
614
  return (0, _map["default"])(items).call(items, function (item, index) {
606
- return (0, _reduce["default"])(cols).call(cols, function (result, _ref12) {
615
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref13) {
607
616
  var _context9;
608
617
 
609
- var key = _ref12.key,
610
- type = _ref12.type,
611
- options = _ref12.options;
618
+ var key = _ref13.key,
619
+ type = _ref13.type,
620
+ options = _ref13.options;
612
621
 
613
622
  if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context9 = item.isReadonly).call(_context9, key))) {
614
623
  result[key] = item[key];
@@ -1,35 +1,35 @@
1
- @import '../variables';
2
-
3
- .@{cloudlink-prefix}-title {
4
- > *:first-child {
5
- display: inline-block;
6
- color: @brand-primary;
7
- line-height: 1.2;
8
-
9
- &[data-border='true'] {
10
- padding: 0 5px;
11
- border-left: @brand-primary solid 3px;
12
- }
13
-
14
- &[data-fold='true'] {
15
- cursor: pointer;
16
- margin: 8px 0;
17
- }
18
-
19
- &[data-required='true'] {
20
- &::after {
21
- display: inline-block;
22
- margin-left: 4px;
23
- color: #f5222d;
24
- font-size: 12px;
25
- font-family: SimSun, sans-serif;
26
- line-height: 1;
27
- content: '*';
28
- }
29
- }
30
- }
31
-
32
- > [role = 'toolbar'] {
33
- display: inline-block;
34
- }
35
- }
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-title {
4
+ > *:first-child {
5
+ display: inline-block;
6
+ color: @brand-primary;
7
+ line-height: 1.2;
8
+
9
+ &[data-border='true'] {
10
+ padding: 0 5px;
11
+ border-left: @brand-primary solid 3px;
12
+ }
13
+
14
+ &[data-fold='true'] {
15
+ cursor: pointer;
16
+ margin: 8px 0;
17
+ }
18
+
19
+ &[data-required='true'] {
20
+ &::after {
21
+ display: inline-block;
22
+ margin-left: 4px;
23
+ color: #f5222d;
24
+ font-size: 12px;
25
+ font-family: SimSun, sans-serif;
26
+ line-height: 1;
27
+ content: '*';
28
+ }
29
+ }
30
+ }
31
+
32
+ > [role = 'toolbar'] {
33
+ display: inline-block;
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "name": "Title",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./Title.js"
6
- }
1
+ {
2
+ "name": "Title",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Title.js"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-b2b",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "A react component library dependent antd",
5
5
  "keywords": [
6
6
  "react",