@dxyl/utils 1.1.9 → 1.2.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.
package/dist/index.es.js CHANGED
@@ -153,7 +153,7 @@ class NB {
153
153
  composedPath() {
154
154
  let t = this.currentTarget, n = [];
155
155
  for (; t; )
156
- n.push(t), t = t.parentNode;
156
+ n.push(t), t = t.parent;
157
157
  return n;
158
158
  }
159
159
  preventDefault() {
@@ -180,7 +180,7 @@ function Zh(e, t) {
180
180
  return r;
181
181
  }
182
182
  class ui {
183
- parentNode = null;
183
+ parent = null;
184
184
  _bubble_emitter = new xe();
185
185
  _capture_emitter = new xe();
186
186
  addEventListener(t, n, r) {
@@ -901,7 +901,40 @@ const IB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
901
901
  merge: kA,
902
902
  zip: HA
903
903
  }, Symbol.toStringTag, { value: "Module" }));
904
- class CB {
904
+ function CB() {
905
+ let e = [];
906
+ const t = {
907
+ add(n, r) {
908
+ r = { stage: 0, once: !1, ...r ?? {} };
909
+ let i = e.findIndex((s) => r.stage < s.stage);
910
+ i !== -1 ? e.splice(i, 0, { fn: n, stage: r.stage, once: r.once }) : e.push({ fn: n, stage: r.stage, once: r.once });
911
+ let o = !1;
912
+ return () => {
913
+ o || (o = !0, t.remove(n));
914
+ };
915
+ },
916
+ remove(n) {
917
+ e = e.filter((r) => r.fn !== n);
918
+ },
919
+ dispatch(...n) {
920
+ let r = !1, i = !1;
921
+ const o = {
922
+ stop: () => {
923
+ r = !0;
924
+ },
925
+ remove: () => {
926
+ i = !0;
927
+ }
928
+ };
929
+ e.some((s) => (s.fn(...n, o), (i || s.once) && t.remove(s.fn), r));
930
+ },
931
+ clear() {
932
+ e.length = 0;
933
+ }
934
+ };
935
+ return t;
936
+ }
937
+ class DB {
905
938
  // 标志要知道列表当前是否正在触发
906
939
  firing = !1;
907
940
  // 非遗忘列表的最后火值
@@ -974,7 +1007,7 @@ class CB {
974
1007
  return this.fireWith(this, t), this;
975
1008
  }
976
1009
  }
977
- class DB {
1010
+ class LB {
978
1011
  heap;
979
1012
  compare;
980
1013
  /**
@@ -1494,7 +1527,7 @@ const jO = (e, t) => {
1494
1527
  if (!e) return "";
1495
1528
  const n = t.replace(/[\W]{1}/g, "\\$&"), r = new RegExp(`^[${n}]+|[${n}]+$`, "g");
1496
1529
  return e.replace(r, "");
1497
- }, LB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1530
+ }, FB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1498
1531
  __proto__: null,
1499
1532
  all: EO,
1500
1533
  alphabetical: iO,
@@ -6048,7 +6081,7 @@ rd && (p.prototype[rd] = gn.toIterator);
6048
6081
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
6049
6082
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
6050
6083
  */
6051
- const FB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6084
+ const jB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6052
6085
  __proto__: null,
6053
6086
  add: F_,
6054
6087
  after: z_,
@@ -7370,7 +7403,7 @@ function Jm(e, t, n) {
7370
7403
  );
7371
7404
  return v[0].length === v[1].length ? v : Jm(v[0], v[1], l);
7372
7405
  }
7373
- const jB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7406
+ const BB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7374
7407
  __proto__: null,
7375
7408
  angleTo: BI,
7376
7409
  clonePath: Di,
@@ -8236,7 +8269,7 @@ function DC(e) {
8236
8269
  function LC(e) {
8237
8270
  return e;
8238
8271
  }
8239
- const BB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8272
+ const zB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8240
8273
  __proto__: null,
8241
8274
  Immer: r1,
8242
8275
  applyPatches: PC,
@@ -11529,7 +11562,7 @@ function M3(e, t) {
11529
11562
  return tt(t) ? t.toList() : X(t) ? t.toMap() : t.toSet();
11530
11563
  }
11531
11564
  var P3 = "5.1.3", I3 = we;
11532
- const zB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11565
+ const UB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11533
11566
  __proto__: null,
11534
11567
  Collection: we,
11535
11568
  Iterable: I3,
@@ -12770,7 +12803,7 @@ function Tn(e, t = 1 / 0, n) {
12770
12803
  }
12771
12804
  return e;
12772
12805
  }
12773
- const UB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12806
+ const VB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12774
12807
  __proto__: null,
12775
12808
  ARRAY_ITERATE_KEY: wi,
12776
12809
  EffectFlags: K3,
@@ -13093,7 +13126,7 @@ function Aw(e) {
13093
13126
  }
13094
13127
  return t._dispose.bind(t);
13095
13128
  }
13096
- const VB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13129
+ const qB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13097
13130
  __proto__: null,
13098
13131
  Signal: Ce,
13099
13132
  batch: VD,
@@ -13417,7 +13450,7 @@ function nL(...e) {
13417
13450
  function rL(e) {
13418
13451
  return ju(e) && "type" in e && typeof e.type == "string";
13419
13452
  }
13420
- const qB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13453
+ const WB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13421
13454
  __proto__: null,
13422
13455
  __DO_NOT_USE__ActionTypes: Yn,
13423
13456
  applyMiddleware: nL,
@@ -16695,7 +16728,7 @@ typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ == "object" && __MOBX_DEVTOOLS_GLOBAL_HOOK_
16695
16728
  },
16696
16729
  $mobx: R
16697
16730
  });
16698
- const WB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16731
+ const kB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16699
16732
  __proto__: null,
16700
16733
  $mobx: R,
16701
16734
  FlowCancellationError: Hu,
@@ -17014,7 +17047,7 @@ class Bj extends mn {
17014
17047
  this.interceptions.done();
17015
17048
  }
17016
17049
  }
17017
- const kB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17050
+ const GB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17018
17051
  __proto__: null,
17019
17052
  AsyncParallelBailHook: Dj,
17020
17053
  AsyncParallelHook: Cj,
@@ -17130,7 +17163,7 @@ class AA {
17130
17163
  this.addOptionFromInstance(t, new zj(this.context, n));
17131
17164
  }
17132
17165
  }
17133
- function GB(...e) {
17166
+ function HB(...e) {
17134
17167
  return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce(
17135
17168
  (t, n) => (...r) => t(n(...r))
17136
17169
  );
@@ -17242,7 +17275,7 @@ function u_(e, t, n) {
17242
17275
  }
17243
17276
  return { r: r * 255, g: i * 255, b: o * 255 };
17244
17277
  }
17245
- function HB(e, t, n) {
17278
+ function KB(e, t, n) {
17246
17279
  e /= 255, t /= 255, n /= 255;
17247
17280
  const r = Math.max(e, t, n), i = Math.min(e, t, n);
17248
17281
  let o = 0, s, a = r;
@@ -17290,11 +17323,11 @@ function nB(e, t, n) {
17290
17323
  }
17291
17324
  return { r: r * 255, g: i * 255, b: o * 255 };
17292
17325
  }
17293
- function KB(e, t, n) {
17326
+ function YB(e, t, n) {
17294
17327
  const r = n + t * Math.min(n, 1 - n), i = r === 0 ? 0 : 2 * (1 - n / r);
17295
17328
  return { h: e, s: i, v: r };
17296
17329
  }
17297
- function YB(e, t, n) {
17330
+ function XB(e, t, n) {
17298
17331
  const r = (2 - t) * n / 2, i = t === 0 ? t : r <= 1 ? t * n / (2 - t * n) : t * n / (2 - t);
17299
17332
  return { h: e, s: i, l: r };
17300
17333
  }
@@ -17904,7 +17937,7 @@ const Jt = (e) => e instanceof Fa ? e : new Fa(e), h_ = [], TB = (e) => {
17904
17937
  r: Math.random() * 255,
17905
17938
  g: Math.random() * 255,
17906
17939
  b: Math.random() * 255
17907
- }), XB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17940
+ }), JB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17908
17941
  __proto__: null,
17909
17942
  colord: Jt,
17910
17943
  extend: TB,
@@ -17915,7 +17948,7 @@ export {
17915
17948
  Xh as AT_TARGET,
17916
17949
  DA as BUBBLING_PHASE,
17917
17950
  CA as CAPTURING_PHASE,
17918
- CB as Callbacks,
17951
+ DB as Callbacks,
17919
17952
  nt as Color,
17920
17953
  Sc as Emitter4Event,
17921
17954
  NB as Event,
@@ -17924,31 +17957,32 @@ export {
17924
17957
  ja as EventPhase,
17925
17958
  ui as EventPropagation,
17926
17959
  ui as EventTarget,
17927
- zB as Immutable,
17960
+ UB as Immutable,
17928
17961
  d_ as NONE,
17929
17962
  AA as Options,
17930
- DB as PriorityQueue,
17931
- jB as antvUtil,
17932
- XB as colord,
17933
- GB as compose,
17963
+ LB as PriorityQueue,
17964
+ CB as Signals,
17965
+ BB as antvUtil,
17966
+ JB as colord,
17967
+ HB as compose,
17934
17968
  Wo as deepmerge,
17935
17969
  Oc as fastDeepEqual,
17936
17970
  rB as hexToRgb,
17937
- KB as hslToHsv,
17971
+ YB as hslToHsv,
17938
17972
  u_ as hslToRgb,
17939
- YB as hsvToHsl,
17973
+ XB as hsvToHsl,
17940
17974
  nB as hsvToRgb,
17941
- BB as immer,
17975
+ zB as immer,
17942
17976
  iB as lerpColor,
17943
- FB as lodash,
17977
+ jB as lodash,
17944
17978
  MB as mitt,
17945
- WB as mobx,
17979
+ kB as mobx,
17946
17980
  IB as observable,
17947
- LB as radash,
17948
- UB as reactivity,
17949
- qB as redux,
17981
+ FB as radash,
17982
+ VB as reactivity,
17983
+ WB as redux,
17950
17984
  tB as rgbToHsl,
17951
- HB as rgbToHsv,
17952
- VB as signals,
17953
- kB as tapable
17985
+ KB as rgbToHsv,
17986
+ qB as signals,
17987
+ GB as tapable
17954
17988
  };