@xysfe/admin-menu 2.4.0 → 2.4.1

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.
@@ -10796,7 +10796,7 @@ module.exports = DESCRIPTORS ? function (object, key, value) {
10796
10796
  /***/ "9224":
10797
10797
  /***/ (function(module) {
10798
10798
 
10799
- module.exports = JSON.parse("{\"a\":\"2.4.0\"}");
10799
+ module.exports = JSON.parse("{\"a\":\"2.4.1\"}");
10800
10800
 
10801
10801
  /***/ }),
10802
10802
 
@@ -18513,15 +18513,22 @@ var findNodeByTag = function findNodeByTag(tag) {
18513
18513
  var throttle = function throttle(func) {
18514
18514
  var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
18515
18515
  var pre = 0;
18516
+ var timeout;
18516
18517
  return function () {
18518
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18519
+ args[_key] = arguments[_key];
18520
+ }
18517
18521
  var context = this;
18518
18522
  var now = Date.now();
18523
+ clearTimeout(timeout);
18519
18524
  if (now - pre >= wait) {
18520
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18521
- args[_key] = arguments[_key];
18522
- }
18523
18525
  func.apply(context, args);
18524
18526
  pre = now;
18527
+ } else {
18528
+ timeout = setTimeout(function () {
18529
+ func.apply(context, args);
18530
+ pre = now;
18531
+ }, wait);
18525
18532
  }
18526
18533
  };
18527
18534
  };
@@ -19708,7 +19715,7 @@ var state_createStore = function createStore() {
19708
19715
  var getMenusByModule = function getMenusByModule() {
19709
19716
  var module = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
19710
19717
  var menuModule = module.filter(function (module) {
19711
- return [1, 2].includes(Number(module.type));
19718
+ return [1, 2].includes(Number(module.type)) && ~~module.permit;
19712
19719
  });
19713
19720
  var menus = treeMenu(menuModule);
19714
19721
  return menus;