ls-pro-common 3.1.52 → 3.1.54
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/dist/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/InputTable.js +7 -5
- package/es/utils/modal.d.ts +10 -0
- package/es/utils/modal.js +22 -1
- package/lib/components/InputTable.js +7 -5
- package/lib/utils/modal.d.ts +10 -0
- package/lib/utils/modal.js +22 -1
- package/package.json +1 -1
|
@@ -144,8 +144,10 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
144
144
|
if (!(formRef === null || formRef === void 0 ? void 0 : formRef.current) && record) return record;
|
|
145
145
|
if (rowKey) {
|
|
146
146
|
var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
|
|
147
|
-
|
|
147
|
+
if (record) return record; //直接返回当前记录
|
|
148
|
+
return formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey]; //返回表格内的表单项。
|
|
148
149
|
}
|
|
150
|
+
|
|
149
151
|
return formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2);
|
|
150
152
|
};
|
|
151
153
|
/**
|
|
@@ -154,13 +156,13 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
154
156
|
* @param formValue
|
|
155
157
|
*/
|
|
156
158
|
var setFormValue = function setFormValue(formValue) {
|
|
159
|
+
var _prop$onChange;
|
|
160
|
+
(_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[name]);
|
|
157
161
|
if (rowKey) {
|
|
158
|
-
var _formRef$current3, _formRef$current3$set
|
|
162
|
+
var _formRef$current3, _formRef$current3$set;
|
|
159
163
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _defineProperty({}, rowKey, formValue));
|
|
160
|
-
(_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[textNameProp]);
|
|
161
164
|
} else {
|
|
162
|
-
var
|
|
163
|
-
(_prop$onChange2 = prop.onChange) === null || _prop$onChange2 === void 0 ? void 0 : _prop$onChange2.call(prop, formValue[name]);
|
|
165
|
+
var _formRef$current4, _formRef$current4$set;
|
|
164
166
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, formValue);
|
|
165
167
|
}
|
|
166
168
|
};
|
package/es/utils/modal.d.ts
CHANGED
|
@@ -18,6 +18,16 @@ export declare const showSuccess: (text: string, duration?: number, opts?: Messa
|
|
|
18
18
|
* @returns Promise<Boolean>
|
|
19
19
|
*/
|
|
20
20
|
export declare const showAlert: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn' | 'confirm', opts?: ModalFuncProps) => Promise<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* 弹框不支持键盘回车和ESC关闭
|
|
23
|
+
*
|
|
24
|
+
* @param text 提示框内容
|
|
25
|
+
* @param title 提示框标题 默认系统提示
|
|
26
|
+
* @param type 提示框类型 默认 error
|
|
27
|
+
* @param opts 附加参数
|
|
28
|
+
* @returns Promise<Boolean>
|
|
29
|
+
*/
|
|
30
|
+
export declare const showAlertNoKeyboard: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn' | 'confirm', opts?: ModalFuncProps) => Promise<unknown>;
|
|
21
31
|
/**
|
|
22
32
|
* 请求接口出错
|
|
23
33
|
*
|
package/es/utils/modal.js
CHANGED
|
@@ -131,11 +131,13 @@ export var showAlert = function showAlert(text) {
|
|
|
131
131
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
132
132
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
133
133
|
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
134
|
+
if (!text) text = '';
|
|
134
135
|
return new Promise(function (resolve, reject) {
|
|
135
136
|
_Modal[type](_objectSpread(_objectSpread({
|
|
136
137
|
content: text,
|
|
137
138
|
title: title,
|
|
138
|
-
getContainer: getFullScreenElement() || document.body
|
|
139
|
+
getContainer: getFullScreenElement() || document.body,
|
|
140
|
+
maskClosable: false
|
|
139
141
|
}, opts), {}, {
|
|
140
142
|
onOk: function onOk() {
|
|
141
143
|
resolve(true);
|
|
@@ -146,6 +148,24 @@ export var showAlert = function showAlert(text) {
|
|
|
146
148
|
}));
|
|
147
149
|
});
|
|
148
150
|
};
|
|
151
|
+
/**
|
|
152
|
+
* 弹框不支持键盘回车和ESC关闭
|
|
153
|
+
*
|
|
154
|
+
* @param text 提示框内容
|
|
155
|
+
* @param title 提示框标题 默认系统提示
|
|
156
|
+
* @param type 提示框类型 默认 error
|
|
157
|
+
* @param opts 附加参数
|
|
158
|
+
* @returns Promise<Boolean>
|
|
159
|
+
*/
|
|
160
|
+
export var showAlertNoKeyboard = function showAlertNoKeyboard(text) {
|
|
161
|
+
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
162
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
163
|
+
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
164
|
+
return showAlert(text, title, type, _objectSpread(_objectSpread({}, opts), {}, {
|
|
165
|
+
keyboard: false,
|
|
166
|
+
autoFocusButton: null
|
|
167
|
+
}));
|
|
168
|
+
};
|
|
149
169
|
/**
|
|
150
170
|
* 请求接口出错
|
|
151
171
|
*
|
|
@@ -167,6 +187,7 @@ export var exitAlert = function exitAlert() {
|
|
|
167
187
|
export var showConfirm = function showConfirm(text) {
|
|
168
188
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
169
189
|
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
190
|
+
if (!text) text = ' ';
|
|
170
191
|
return new Promise(function (resolve, reject) {
|
|
171
192
|
_Modal.confirm(_objectSpread(_objectSpread({
|
|
172
193
|
title: title,
|
|
@@ -144,8 +144,10 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
144
144
|
if (!(formRef === null || formRef === void 0 ? void 0 : formRef.current) && record) return record;
|
|
145
145
|
if (rowKey) {
|
|
146
146
|
var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
|
|
147
|
-
|
|
147
|
+
if (record) return record; //直接返回当前记录
|
|
148
|
+
return formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey]; //返回表格内的表单项。
|
|
148
149
|
}
|
|
150
|
+
|
|
149
151
|
return formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2);
|
|
150
152
|
};
|
|
151
153
|
/**
|
|
@@ -154,13 +156,13 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
154
156
|
* @param formValue
|
|
155
157
|
*/
|
|
156
158
|
var setFormValue = function setFormValue(formValue) {
|
|
159
|
+
var _prop$onChange;
|
|
160
|
+
(_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[name]);
|
|
157
161
|
if (rowKey) {
|
|
158
|
-
var _formRef$current3, _formRef$current3$set
|
|
162
|
+
var _formRef$current3, _formRef$current3$set;
|
|
159
163
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _defineProperty({}, rowKey, formValue));
|
|
160
|
-
(_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[textNameProp]);
|
|
161
164
|
} else {
|
|
162
|
-
var
|
|
163
|
-
(_prop$onChange2 = prop.onChange) === null || _prop$onChange2 === void 0 ? void 0 : _prop$onChange2.call(prop, formValue[name]);
|
|
165
|
+
var _formRef$current4, _formRef$current4$set;
|
|
164
166
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, formValue);
|
|
165
167
|
}
|
|
166
168
|
};
|
package/lib/utils/modal.d.ts
CHANGED
|
@@ -18,6 +18,16 @@ export declare const showSuccess: (text: string, duration?: number, opts?: Messa
|
|
|
18
18
|
* @returns Promise<Boolean>
|
|
19
19
|
*/
|
|
20
20
|
export declare const showAlert: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn' | 'confirm', opts?: ModalFuncProps) => Promise<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* 弹框不支持键盘回车和ESC关闭
|
|
23
|
+
*
|
|
24
|
+
* @param text 提示框内容
|
|
25
|
+
* @param title 提示框标题 默认系统提示
|
|
26
|
+
* @param type 提示框类型 默认 error
|
|
27
|
+
* @param opts 附加参数
|
|
28
|
+
* @returns Promise<Boolean>
|
|
29
|
+
*/
|
|
30
|
+
export declare const showAlertNoKeyboard: (text: React.ReactDOM | string, title?: string, type?: 'error' | 'info' | 'success' | 'warn' | 'confirm', opts?: ModalFuncProps) => Promise<unknown>;
|
|
21
31
|
/**
|
|
22
32
|
* 请求接口出错
|
|
23
33
|
*
|
package/lib/utils/modal.js
CHANGED
|
@@ -131,11 +131,13 @@ export var showAlert = function showAlert(text) {
|
|
|
131
131
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
132
132
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
133
133
|
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
134
|
+
if (!text) text = '';
|
|
134
135
|
return new Promise(function (resolve, reject) {
|
|
135
136
|
_Modal[type](_objectSpread(_objectSpread({
|
|
136
137
|
content: text,
|
|
137
138
|
title: title,
|
|
138
|
-
getContainer: getFullScreenElement() || document.body
|
|
139
|
+
getContainer: getFullScreenElement() || document.body,
|
|
140
|
+
maskClosable: false
|
|
139
141
|
}, opts), {}, {
|
|
140
142
|
onOk: function onOk() {
|
|
141
143
|
resolve(true);
|
|
@@ -146,6 +148,24 @@ export var showAlert = function showAlert(text) {
|
|
|
146
148
|
}));
|
|
147
149
|
});
|
|
148
150
|
};
|
|
151
|
+
/**
|
|
152
|
+
* 弹框不支持键盘回车和ESC关闭
|
|
153
|
+
*
|
|
154
|
+
* @param text 提示框内容
|
|
155
|
+
* @param title 提示框标题 默认系统提示
|
|
156
|
+
* @param type 提示框类型 默认 error
|
|
157
|
+
* @param opts 附加参数
|
|
158
|
+
* @returns Promise<Boolean>
|
|
159
|
+
*/
|
|
160
|
+
export var showAlertNoKeyboard = function showAlertNoKeyboard(text) {
|
|
161
|
+
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
162
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
163
|
+
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
164
|
+
return showAlert(text, title, type, _objectSpread(_objectSpread({}, opts), {}, {
|
|
165
|
+
keyboard: false,
|
|
166
|
+
autoFocusButton: null
|
|
167
|
+
}));
|
|
168
|
+
};
|
|
149
169
|
/**
|
|
150
170
|
* 请求接口出错
|
|
151
171
|
*
|
|
@@ -167,6 +187,7 @@ export var exitAlert = function exitAlert() {
|
|
|
167
187
|
export var showConfirm = function showConfirm(text) {
|
|
168
188
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
169
189
|
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
190
|
+
if (!text) text = ' ';
|
|
170
191
|
return new Promise(function (resolve, reject) {
|
|
171
192
|
_Modal.confirm(_objectSpread(_objectSpread({
|
|
172
193
|
title: title,
|