Comparing version 1.1.3 to 1.1.4
@@ -22,2 +22,3 @@ /// <reference types="react" /> | ||
exitEditMode(record: any, save: boolean): void; | ||
add(): void; | ||
edit(record: any): void; | ||
@@ -29,4 +30,3 @@ renderColumns(text: any, record: any, column: Column<T>): any; | ||
search(pagination: any, filters: any, sorter: any): void; | ||
add(): void; | ||
render(): JSX.Element; | ||
} |
@@ -120,2 +120,17 @@ "use strict"; | ||
}; | ||
ListModal.prototype.add = function () { | ||
if (this.mode === interface_1.MODE.COMMON) { | ||
this.mode = interface_1.MODE.ADD; | ||
var list = _.concat([], this.state.list); | ||
var obj_1 = _.assign({ _edit: true, _add: true, }, this.props.param); | ||
this.props.columns.map(function (column) { | ||
if (column.options) { | ||
obj_1[column.dataIndex] = column.options[0].value; | ||
} | ||
}); | ||
this.editObject = _.assign({}, obj_1); | ||
list.unshift(_.assign({}, obj_1)); | ||
this.setState({ list: list }); | ||
} | ||
}; | ||
ListModal.prototype.edit = function (record) { | ||
@@ -125,3 +140,3 @@ var _this = this; | ||
this.mode = interface_1.MODE.EDIT; | ||
this.editObject = _.assign({}, record); | ||
this.editObject = _.assign({}, this.props.param, record); | ||
var list = _.concat([], this.state.list); | ||
@@ -141,3 +156,3 @@ list.map(function (item) { | ||
var _this = this; | ||
if (column.readonly) { | ||
if (column.readonly && this.mode == interface_1.MODE.EDIT) { | ||
if (column.options) { | ||
@@ -169,3 +184,3 @@ var val = _.find(column.options, { value: text + '' }); | ||
else { | ||
return record._edit ? React.createElement(antd_1.Input, { size: "small", style: { padding: 0, height: 22 }, defaultValue: text, onChange: function (e) { (function (txt) { return _this.editObject[column.dataIndex] = txt; }); } }) : text; | ||
return record._edit ? React.createElement(antd_1.Input, { size: "small", style: { padding: 0, height: 22 }, defaultValue: text, onChange: function (e) { return _this.editObject[column.dataIndex] = e.target.value; } }) : text; | ||
} | ||
@@ -252,20 +267,2 @@ }; | ||
}; | ||
ListModal.prototype.add = function () { | ||
if (this.mode === interface_1.MODE.COMMON) { | ||
this.mode = interface_1.MODE.ADD; | ||
var list = _.concat([], this.state.list); | ||
var obj_1 = _.assign({ | ||
_edit: true, | ||
_add: true, | ||
}, this.props.param); | ||
this.props.columns.map(function (column) { | ||
if (column.options) { | ||
obj_1[column.dataIndex] = column.options[0].value; | ||
} | ||
}); | ||
this.editObject = _.assign({}, obj_1); | ||
list.unshift(_.assign({}, obj_1)); | ||
this.setState({ list: list }); | ||
} | ||
}; | ||
ListModal.prototype.render = function () { | ||
@@ -272,0 +269,0 @@ var _this = this; |
{ | ||
"name": "vap", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "vap", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79380
1944