ls-pro-common 3.1.52 → 3.1.53

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.
@@ -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,
@@ -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
  *
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.52",
3
+ "version": "3.1.53",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [