nhanh-pure-function 1.2.2 → 1.2.3

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.
Files changed (2) hide show
  1. package/lib/User.js +5 -8
  2. package/package.json +1 -1
package/lib/User.js CHANGED
@@ -394,19 +394,16 @@ export class _LoadingController {
394
394
  * @param options.uiLibrary 项目使用的 ui库 , 用于排除 ui库 创建的元素 , 避免点击 ui库 创建的元素时意外的执行 callback
395
395
  * @param options.isClickAllowed 是否允许该点击 ( 如果不确定可以返回 undefined )
396
396
  */
397
- export function _CloseOnOutsideClick(
398
- querySelector,
399
- callback,
400
- options = {
401
- uiLibrary: ["naiveUI", "ElementPlus", "Element"],
402
- }
403
- ) {
397
+ export function _CloseOnOutsideClick(querySelector, callback, options) {
404
398
  function end() {
405
399
  callback();
406
400
  document.removeEventListener("mousedown", mousedown);
407
401
  }
408
402
  function mousedown(event) {
409
- const { isClickAllowed, uiLibrary } = options;
403
+ const {
404
+ isClickAllowed,
405
+ uiLibrary = ["naiveUI", "ElementPlus", "Element"],
406
+ } = options || {};
410
407
 
411
408
  if (isClickAllowed) {
412
409
  const bool = isClickAllowed(event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhanh-pure-function",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "纯函数工具",
5
5
  "main": "lib/Index.js",
6
6
  "scripts": {