e-virt-table 0.0.12 → 0.0.14

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
@@ -149,7 +149,7 @@ function Oe(a) {
149
149
  t.push.apply(t, a[e] || []);
150
150
  }), t;
151
151
  }
152
- var Ft = /* @__PURE__ */ function(a) {
152
+ var Nt = /* @__PURE__ */ function(a) {
153
153
  be(t, a);
154
154
  function t(e, i) {
155
155
  var s;
@@ -161,7 +161,7 @@ function Se(a, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var o = new Promise(function(x, u) {
163
163
  var y = function(p) {
164
- return i(p), p.length ? u(new Ft(p, Ct(p))) : x(s);
164
+ return i(p), p.length ? u(new Nt(p, Ct(p))) : x(s);
165
165
  }, g = Oe(a);
166
166
  kt(g, e, y);
167
167
  });
@@ -172,7 +172,7 @@ function Se(a, t, e, i, s) {
172
172
  var r = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), l = n.length, h = 0, f = [], d = new Promise(function(x, u) {
173
173
  var y = function(w) {
174
174
  if (f.push.apply(f, w), h++, h === l)
175
- return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
175
+ return i(f), f.length ? u(new Nt(f, Ct(f))) : x(s);
176
176
  };
177
177
  n.length || (i(f), x(s)), n.forEach(function(g) {
178
178
  var w = a[g];
@@ -194,7 +194,7 @@ function Le(a, t) {
194
194
  }
195
195
  return e;
196
196
  }
197
- function Nt(a, t) {
197
+ function Ft(a, t) {
198
198
  return function(e) {
199
199
  var i;
200
200
  return a.fullFields ? i = Le(t, a.fullFields) : i = t[e.field || a.fullField], Te(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
@@ -322,7 +322,7 @@ var Ut = function(t, e, i, s, o, r) {
322
322
  range: De,
323
323
  enum: Xe,
324
324
  pattern: ke
325
- }, Fe = function(t, e, i, s, o) {
325
+ }, Ne = function(t, e, i, s, o) {
326
326
  var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
327
327
  if (n) {
328
328
  if (I(e, "string") && !t.required)
@@ -330,7 +330,7 @@ var Ut = function(t, e, i, s, o, r) {
330
330
  v.required(t, e, s, r, o, "string"), I(e, "string") || (v.type(t, e, s, r, o), v.range(t, e, s, r, o), v.pattern(t, e, s, r, o), t.whitespace === !0 && v.whitespace(t, e, s, r, o));
331
331
  }
332
332
  i(r);
333
- }, Ne = function(t, e, i, s, o) {
333
+ }, Fe = function(t, e, i, s, o) {
334
334
  var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
335
335
  if (n) {
336
336
  if (I(e) && !t.required)
@@ -378,7 +378,7 @@ var Ut = function(t, e, i, s, o, r) {
378
378
  v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
379
379
  }
380
380
  i(r);
381
- }, Ve = function(t, e, i, s, o) {
381
+ }, ze = function(t, e, i, s, o) {
382
382
  var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
383
383
  if (n) {
384
384
  if (e == null && !t.required)
@@ -386,7 +386,7 @@ var Ut = function(t, e, i, s, o, r) {
386
386
  v.required(t, e, s, r, o, "array"), e != null && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
387
387
  }
388
388
  i(r);
389
- }, ze = function(t, e, i, s, o) {
389
+ }, Ve = function(t, e, i, s, o) {
390
390
  var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
391
391
  if (n) {
392
392
  if (I(e) && !t.required)
@@ -441,15 +441,15 @@ var Ut = function(t, e, i, s, o, r) {
441
441
  }
442
442
  i(r);
443
443
  }, it = {
444
- string: Fe,
445
- method: Ne,
444
+ string: Ne,
445
+ method: Fe,
446
446
  number: Ye,
447
447
  boolean: Ke,
448
448
  regexp: Be,
449
449
  integer: We,
450
450
  float: Pe,
451
- array: Ve,
452
- object: ze,
451
+ array: ze,
452
+ object: Ve,
453
453
  enum: qe,
454
454
  pattern: Ge,
455
455
  date: je,
@@ -583,14 +583,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
583
583
  R === void 0 && (R = []);
584
584
  var T = Array.isArray(R) ? R : [R];
585
585
  !l.suppressWarning && T.length && a.warning("async-validator:", T), T.length && p.message !== void 0 && (T = [].concat(p.message));
586
- var L = T.map(Nt(p, n));
586
+ var L = T.map(Ft(p, n));
587
587
  if (l.first && L.length)
588
588
  return y[p.field] = 1, w(L);
589
589
  if (!E)
590
590
  w(L);
591
591
  else {
592
592
  if (p.required && !g.value)
593
- return p.message !== void 0 ? L = [].concat(p.message).map(Nt(p, n)) : l.error && (L = [l.error(p, M(l.messages.required, p.field))]), w(L);
593
+ return p.message !== void 0 ? L = [].concat(p.message).map(Ft(p, n)) : l.error && (L = [l.error(p, M(l.messages.required, p.field))]), w(L);
594
594
  var A = {};
595
595
  p.defaultField && Object.keys(g.value).map(function(_) {
596
596
  A[_] = p.defaultField;
@@ -1436,7 +1436,7 @@ class ri {
1436
1436
  this.ctx = t, this.init();
1437
1437
  }
1438
1438
  init() {
1439
- this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mousedown", this.handleMouseDown.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.target, "click", this.handleClick.bind(this)), this.bind(this.ctx.target, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.target, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.target, "contextmenu", this.handleContextMenu.bind(this));
1439
+ this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mousedown", this.handleMouseDown.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "scroll", this.handleScroll.bind(this)), this.bind(this.ctx.target, "click", this.handleClick.bind(this)), this.bind(this.ctx.target, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.target, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.target, "contextmenu", this.handleContextMenu.bind(this));
1440
1440
  }
1441
1441
  destroy() {
1442
1442
  this.eventTasks.forEach((t, e) => {
@@ -1468,6 +1468,9 @@ class ri {
1468
1468
  handleContextMenu(t) {
1469
1469
  this.ctx.emit("contextMenu", t);
1470
1470
  }
1471
+ handleScroll(t) {
1472
+ this.ctx.emit("scroll", t);
1473
+ }
1471
1474
  bind(t, e, i) {
1472
1475
  t instanceof HTMLCanvasElement && e === "keydown" && (t.tabIndex = 0), t.addEventListener(e, i), this.eventTasks.set(e, i);
1473
1476
  }
@@ -1676,6 +1679,8 @@ class Pt {
1676
1679
  c(this, "ENABLE_OFFSET_HEIGHT", !1);
1677
1680
  c(this, "OFFSET_HEIGHT", 0);
1678
1681
  c(this, "HEADER_HEIGHT", 36);
1682
+ c(this, "ENABLE_HEADER_STICKY", !1);
1683
+ // 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
1679
1684
  c(this, "HEADER_BG_COLOR", "#F8FAFF");
1680
1685
  c(this, "BODY_BG_COLOR", "#FFF");
1681
1686
  c(this, "HEADER_TEXT_COLOR", "#1D2129");
@@ -2468,7 +2473,7 @@ class ie extends te {
2468
2473
  left: e,
2469
2474
  top: `${this.drawY + 1}px`,
2470
2475
  width: `${this.width}px`,
2471
- height: `${this.height}px`,
2476
+ height: `${this.height - 2}px`,
2472
2477
  pointerEvents: "none"
2473
2478
  };
2474
2479
  }
@@ -2816,7 +2821,7 @@ class li {
2816
2821
  this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
2817
2822
  }
2818
2823
  }
2819
- class Vt {
2824
+ class zt {
2820
2825
  constructor(t, e) {
2821
2826
  c(this, "ctx");
2822
2827
  c(this, "type");
@@ -2849,6 +2854,8 @@ class Vt {
2849
2854
  onMouseDown(t) {
2850
2855
  if (!(t.target instanceof HTMLCanvasElement) || !this.ctx.isTarget(t.target))
2851
2856
  return;
2857
+ if (this.ctx.target.style.cursor === "row-resize" || this.ctx.target.style.cursor === "col-resize")
2858
+ return !0;
2852
2859
  const { offsetX: e, offsetY: i, clientX: s, clientY: o } = t;
2853
2860
  if (!(s == this.clientX && o == this.clientY)) {
2854
2861
  if (this.isOnScrollbar(e, i))
@@ -2928,7 +2935,7 @@ class hi {
2928
2935
  c(this, "ctx");
2929
2936
  c(this, "verticalScrollbar");
2930
2937
  c(this, "horizontalScrollbar");
2931
- this.ctx = t, this.verticalScrollbar = new Vt(t, "vertical"), this.horizontalScrollbar = new Vt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
2938
+ this.ctx = t, this.verticalScrollbar = new zt(t, "vertical"), this.horizontalScrollbar = new zt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
2932
2939
  this.setScroll(e, i);
2933
2940
  }), this.ctx.on("setScrollX", (e) => {
2934
2941
  this.setScrollX(e);
@@ -2997,7 +3004,7 @@ class di {
2997
3004
  // 调整列的数量
2998
3005
  c(this, "isResizing", !1);
2999
3006
  // 是否移动中
3000
- c(this, "offsetX", 0);
3007
+ c(this, "clientX", 0);
3001
3008
  // 鼠标按下时的x轴位置
3002
3009
  c(this, "resizeDiff", 0);
3003
3010
  // 是否移动中
@@ -3050,9 +3057,9 @@ class di {
3050
3057
  config: { ENABLE_RESIZE_COLUMN: t }
3051
3058
  } = this.ctx;
3052
3059
  t && (this.ctx.on("mousedown", (e) => {
3053
- this.ctx.isTarget(e.target) && (this.offsetX = e.offsetX, this.resizeTarget ? (this.isResizing = !0, this.ctx.columnResizing = !0) : this.isResizing = !1, this.isMouseDown = !0);
3060
+ this.ctx.isTarget(e.target) && (this.clientX = e.clientX, this.resizeTarget ? (this.isResizing = !0, this.ctx.columnResizing = !0) : this.isResizing = !1, this.isMouseDown = !0);
3054
3061
  }), this.ctx.on("mouseup", () => {
3055
- this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.ctx.columnResizing = !1, this.offsetX = 0;
3062
+ this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.ctx.columnResizing = !1, this.clientX = 0;
3056
3063
  }), this.ctx.on("mousemove", (e) => {
3057
3064
  if (this.ctx.editing) return;
3058
3065
  const {
@@ -3061,7 +3068,7 @@ class di {
3061
3068
  } = this.ctx;
3062
3069
  if (this.isResizing && this.resizeTarget) {
3063
3070
  const o = this.resizeTarget.width;
3064
- let r = e.offsetX - this.offsetX;
3071
+ let r = e.clientX - this.clientX;
3065
3072
  r + o < s && (r = -(o - s)), this.resizeDiff = r, this.ctx.emit("draw");
3066
3073
  } else {
3067
3074
  if (this.resizeTarget = null, this.isMouseDown)
@@ -3248,7 +3255,7 @@ class fi {
3248
3255
  // 是否按下
3249
3256
  c(this, "resizeDiff", 0);
3250
3257
  // 是否移动中
3251
- c(this, "offsetY", 0);
3258
+ c(this, "clientY", 0);
3252
3259
  // 鼠标按下时的y轴位置
3253
3260
  c(this, "ctx");
3254
3261
  c(this, "x", 0);
@@ -3322,30 +3329,30 @@ class fi {
3322
3329
  t && (this.ctx.on("mouseup", () => {
3323
3330
  this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeRow(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.resizeDiff = 0, this.isResizing = !1, setTimeout(() => {
3324
3331
  this.ctx.rowResizing = !1;
3325
- }, 0), this.offsetY = 0;
3332
+ }, 0), this.clientY = 0;
3326
3333
  }), this.ctx.on("mousedown", (e) => {
3327
- this.ctx.isTarget(e.target) && (this.offsetY = e.offsetY, this.resizeTarget ? (this.isResizing = !0, this.ctx.rowResizing = !0) : (this.isResizing = !1, this.ctx.rowResizing = !1), this.isMouseDown = !0);
3334
+ this.ctx.isTarget(e.target) && (this.clientY = e.clientY, this.resizeTarget ? (this.isResizing = !0, this.ctx.rowResizing = !0) : (this.isResizing = !1, this.ctx.rowResizing = !1), this.isMouseDown = !0);
3328
3335
  }), this.ctx.on("mousemove", (e) => {
3329
3336
  if (this.ctx.editing) return;
3330
- const i = e.offsetY, s = e.offsetX, {
3331
- target: o,
3332
- scrollY: r,
3333
- config: { RESIZE_ROW_MIN_HEIGHT: n = 0 }
3337
+ const i = e.offsetY, s = e.offsetX, o = e.clientY, {
3338
+ target: r,
3339
+ scrollY: n,
3340
+ config: { RESIZE_ROW_MIN_HEIGHT: l = 0 }
3334
3341
  } = this.ctx;
3335
3342
  if (this.isResizing && this.resizeTarget) {
3336
- const l = this.resizeTarget.height;
3337
- let h = i - this.offsetY;
3338
- h + l < n && (h = -(l - n)), this.resizeDiff = h, this.ctx.emit("draw");
3343
+ const h = this.resizeTarget.height;
3344
+ let f = o - this.clientY;
3345
+ f + h < l && (f = -(h - l)), this.resizeDiff = f, this.ctx.emit("draw");
3339
3346
  } else {
3340
3347
  if (this.resizeTarget = null, this.isMouseDown || this.ctx.target.style.cursor === "crosshair")
3341
3348
  return;
3342
3349
  this.ctx.target.style.cursor === "row-resize" && (this.ctx.target.style.cursor = "default");
3343
- for (let l = 0; l < this.renderRows.length; l++) {
3344
- const h = this.renderRows[l];
3345
- if (i > h.y - r + h.height - 1.5 && i < h.y - r + h.height + 1.5 && i < o.height - 4)
3346
- for (let d = 0; d < h.cells.length; d++) {
3347
- const x = h.cells[d];
3348
- s > x.drawX + 10 && s < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.target.style.cursor = "row-resize", this.resizeTarget = h);
3350
+ for (let h = 0; h < this.renderRows.length; h++) {
3351
+ const f = this.renderRows[h];
3352
+ if (i > f.y - n + f.height - 1.5 && i < f.y - n + f.height + 1.5 && i < r.height - 4)
3353
+ for (let x = 0; x < f.cells.length; x++) {
3354
+ const u = f.cells[x];
3355
+ s > u.drawX + 10 && s < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.target.style.cursor = "row-resize", this.resizeTarget = f);
3349
3356
  }
3350
3357
  }
3351
3358
  }
@@ -3620,7 +3627,7 @@ class ui {
3620
3627
  }
3621
3628
  }
3622
3629
  selectCols(t) {
3623
- if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_ROWS || this.ctx.autofillMove || this.ctx.columnResizing)
3630
+ if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_ROWS || this.ctx.autofillMove || this.ctx.columnResizing || this.ctx.editing)
3624
3631
  return;
3625
3632
  if (t.operation) {
3626
3633
  this.selectAll();
@@ -3642,7 +3649,7 @@ class ui {
3642
3649
  }
3643
3650
  }
3644
3651
  selectAll() {
3645
- if (this.ctx.autofillMove)
3652
+ if (this.ctx.autofillMove || this.ctx.editing)
3646
3653
  return;
3647
3654
  const { ENABLE_SELECTOR_ALL_ROWS: t, ENABLE_SELECTOR_ALL_COLS: e } = this.ctx.config;
3648
3655
  if (t && e) {
@@ -3651,7 +3658,7 @@ class ui {
3651
3658
  }
3652
3659
  }
3653
3660
  selectRows(t, e = !0) {
3654
- if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_COLS || this.ctx.autofillMove)
3661
+ if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_COLS || this.ctx.autofillMove || this.ctx.editing)
3655
3662
  return;
3656
3663
  const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s } = this.ctx.config, o = s || this.ctx.maxColIndex, r = i;
3657
3664
  if (e) {
@@ -3671,7 +3678,7 @@ class ui {
3671
3678
  }
3672
3679
  }
3673
3680
  mouseenter() {
3674
- if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
3681
+ if (this.ctx.config.ENABLE_SELECTOR_SINGLE || this.ctx.editing)
3675
3682
  return;
3676
3683
  const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
3677
3684
  if (t && e && i) {
@@ -3975,7 +3982,7 @@ class gi {
3975
3982
  destroy() {
3976
3983
  }
3977
3984
  }
3978
- const rt = Math.min, U = Math.max, ft = Math.round, V = (a) => ({
3985
+ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
3979
3986
  x: a,
3980
3987
  y: a
3981
3988
  }), wi = {
@@ -4080,7 +4087,7 @@ function ut(a) {
4080
4087
  y: e
4081
4088
  };
4082
4089
  }
4083
- function zt(a, t, e) {
4090
+ function Vt(a, t, e) {
4084
4091
  let {
4085
4092
  reference: i,
4086
4093
  floating: s
@@ -4142,7 +4149,7 @@ const vi = async (a, t, e) => {
4142
4149
  }), {
4143
4150
  x: f,
4144
4151
  y: d
4145
- } = zt(h, i, l), x = i, u = {}, y = 0;
4152
+ } = Vt(h, i, l), x = i, u = {}, y = 0;
4146
4153
  for (let g = 0; g < n.length; g++) {
4147
4154
  const {
4148
4155
  name: w,
@@ -4179,7 +4186,7 @@ const vi = async (a, t, e) => {
4179
4186
  }) : C.rects), {
4180
4187
  x: f,
4181
4188
  y: d
4182
- } = zt(h, x, l)), g = -1);
4189
+ } = Vt(h, x, l)), g = -1);
4183
4190
  }
4184
4191
  return {
4185
4192
  x: f,
@@ -4258,14 +4265,14 @@ const Ri = (a) => ({
4258
4265
  }, u = Ht(s), y = Mt(u), g = await r.getDimensions(h), w = u === "y", p = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", b = o.reference[y] + o.reference[u] - x[u] - o.floating[y], C = x[u] - o.reference[u], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
4259
4266
  let T = R ? R[m] : 0;
4260
4267
  (!T || !await (r.isElement == null ? void 0 : r.isElement(R))) && (T = n.floating[m] || o.floating[y]);
4261
- const L = b / 2 - C / 2, A = T / 2 - g[y] / 2 - 1, D = rt(d[p], A), B = rt(d[E], A), _ = D, S = T - g[y] - B, O = T / 2 - g[y] / 2 + L, G = _t(_, O, S), Y = !l.arrow && ct(s) != null && O !== G && o.reference[y] / 2 - (O < _ ? D : B) - g[y] / 2 < 0, F = Y ? O < _ ? O - _ : O - S : 0;
4268
+ const L = b / 2 - C / 2, A = T / 2 - g[y] / 2 - 1, D = rt(d[p], A), B = rt(d[E], A), _ = D, S = T - g[y] - B, O = T / 2 - g[y] / 2 + L, G = _t(_, O, S), Y = !l.arrow && ct(s) != null && O !== G && o.reference[y] / 2 - (O < _ ? D : B) - g[y] / 2 < 0, N = Y ? O < _ ? O - _ : O - S : 0;
4262
4269
  return {
4263
- [u]: x[u] + F,
4270
+ [u]: x[u] + N,
4264
4271
  data: {
4265
4272
  [u]: G,
4266
- centerOffset: O - G - F,
4273
+ centerOffset: O - G - N,
4267
4274
  ...Y && {
4268
- alignmentOffset: F
4275
+ alignmentOffset: N
4269
4276
  }
4270
4277
  },
4271
4278
  reset: Y
@@ -4319,12 +4326,12 @@ const Ri = (a) => ({
4319
4326
  placement: G
4320
4327
  }
4321
4328
  };
4322
- let Y = (_ = D.filter((F) => F.overflows[0] <= 0).sort((F, W) => F.overflows[1] - W.overflows[1])[0]) == null ? void 0 : _.placement;
4329
+ let Y = (_ = D.filter((N) => N.overflows[0] <= 0).sort((N, W) => N.overflows[1] - W.overflows[1])[0]) == null ? void 0 : _.placement;
4323
4330
  if (!Y)
4324
4331
  switch (u) {
4325
4332
  case "bestFit": {
4326
4333
  var S;
4327
- const F = (S = D.filter((W) => {
4334
+ const N = (S = D.filter((W) => {
4328
4335
  if (R) {
4329
4336
  const P = J(W.placement);
4330
4337
  return P === E || // Create a bias to the `y` side axis due to horizontal
@@ -4333,7 +4340,7 @@ const Ri = (a) => ({
4333
4340
  }
4334
4341
  return !0;
4335
4342
  }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
4336
- F && (Y = F);
4343
+ N && (Y = N);
4337
4344
  break;
4338
4345
  }
4339
4346
  case "initialPlacement":
@@ -4477,7 +4484,7 @@ function ae(a) {
4477
4484
  function X(a) {
4478
4485
  return gt() ? a instanceof Element || a instanceof H(a).Element : !1;
4479
4486
  }
4480
- function N(a) {
4487
+ function F(a) {
4481
4488
  return gt() ? a instanceof HTMLElement || a instanceof H(a).HTMLElement : !1;
4482
4489
  }
4483
4490
  function $t(a) {
@@ -4509,13 +4516,13 @@ function Dt(a) {
4509
4516
  return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
4510
4517
  }
4511
4518
  function Li(a) {
4512
- let t = z(a);
4513
- for (; N(t) && !Q(t); ) {
4519
+ let t = V(a);
4520
+ for (; F(t) && !Q(t); ) {
4514
4521
  if (Dt(t))
4515
4522
  return t;
4516
4523
  if (wt(t))
4517
4524
  return null;
4518
- t = z(t);
4525
+ t = V(t);
4519
4526
  }
4520
4527
  return null;
4521
4528
  }
@@ -4537,7 +4544,7 @@ function pt(a) {
4537
4544
  scrollTop: a.scrollY
4538
4545
  };
4539
4546
  }
4540
- function z(a) {
4547
+ function V(a) {
4541
4548
  if (tt(a) === "html")
4542
4549
  return a;
4543
4550
  const t = (
@@ -4550,8 +4557,8 @@ function z(a) {
4550
4557
  return $t(t) ? t.host : t;
4551
4558
  }
4552
4559
  function ce(a) {
4553
- const t = z(a);
4554
- return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && lt(t) ? t : ce(t);
4560
+ const t = V(a);
4561
+ return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : F(t) && lt(t) ? t : ce(t);
4555
4562
  }
4556
4563
  function St(a, t, e) {
4557
4564
  var i;
@@ -4569,7 +4576,7 @@ function Tt(a) {
4569
4576
  function le(a) {
4570
4577
  const t = k(a);
4571
4578
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
4572
- const s = N(a), o = s ? a.offsetWidth : e, r = s ? a.offsetHeight : i, n = ft(e) !== o || ft(i) !== r;
4579
+ const s = F(a), o = s ? a.offsetWidth : e, r = s ? a.offsetHeight : i, n = ft(e) !== o || ft(i) !== r;
4573
4580
  return n && (e = o, i = r), {
4574
4581
  width: e,
4575
4582
  height: i,
@@ -4581,8 +4588,8 @@ function he(a) {
4581
4588
  }
4582
4589
  function Z(a) {
4583
4590
  const t = he(a);
4584
- if (!N(t))
4585
- return V(1);
4591
+ if (!F(t))
4592
+ return z(1);
4586
4593
  const e = t.getBoundingClientRect(), {
4587
4594
  width: i,
4588
4595
  height: s,
@@ -4594,7 +4601,7 @@ function Z(a) {
4594
4601
  y: n
4595
4602
  };
4596
4603
  }
4597
- const Ai = /* @__PURE__ */ V(0);
4604
+ const Ai = /* @__PURE__ */ z(0);
4598
4605
  function de(a) {
4599
4606
  const t = H(a);
4600
4607
  return !Xt() || !t.visualViewport ? Ai : {
@@ -4608,9 +4615,9 @@ function Mi(a, t, e) {
4608
4615
  function ot(a, t, e, i) {
4609
4616
  t === void 0 && (t = !1), e === void 0 && (e = !1);
4610
4617
  const s = a.getBoundingClientRect(), o = he(a);
4611
- let r = V(1);
4618
+ let r = z(1);
4612
4619
  t && (i ? X(i) && (r = Z(i)) : r = Z(a));
4613
- const n = Mi(o, e, i) ? de(o) : V(0);
4620
+ const n = Mi(o, e, i) ? de(o) : z(0);
4614
4621
  let l = (s.left + n.x) / r.x, h = (s.top + n.y) / r.y, f = s.width / r.x, d = s.height / r.y;
4615
4622
  if (o) {
4616
4623
  const x = H(o), u = i && X(i) ? H(i) : i;
@@ -4640,9 +4647,9 @@ function Hi(a) {
4640
4647
  let l = {
4641
4648
  scrollLeft: 0,
4642
4649
  scrollTop: 0
4643
- }, h = V(1);
4644
- const f = V(0), d = N(i);
4645
- if ((d || !d && !o) && ((tt(i) !== "body" || lt(r)) && (l = pt(i)), N(i))) {
4650
+ }, h = z(1);
4651
+ const f = z(0), d = F(i);
4652
+ if ((d || !d && !o) && ((tt(i) !== "body" || lt(r)) && (l = pt(i)), F(i))) {
4646
4653
  const x = ot(i);
4647
4654
  h = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
4648
4655
  }
@@ -4686,8 +4693,8 @@ function ki(a, t) {
4686
4693
  y: l
4687
4694
  };
4688
4695
  }
4689
- function Fi(a, t) {
4690
- const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, o = N(a) ? Z(a) : V(1), r = a.clientWidth * o.x, n = a.clientHeight * o.y, l = s * o.x, h = i * o.y;
4696
+ function Ni(a, t) {
4697
+ const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, o = F(a) ? Z(a) : z(1), r = a.clientWidth * o.x, n = a.clientHeight * o.y, l = s * o.x, h = i * o.y;
4691
4698
  return {
4692
4699
  width: r,
4693
4700
  height: n,
@@ -4702,7 +4709,7 @@ function qt(a, t, e) {
4702
4709
  else if (t === "document")
4703
4710
  i = Xi(K(a));
4704
4711
  else if (X(t))
4705
- i = Fi(t, e);
4712
+ i = Ni(t, e);
4706
4713
  else {
4707
4714
  const s = de(a);
4708
4715
  i = {
@@ -4714,19 +4721,19 @@ function qt(a, t, e) {
4714
4721
  return ut(i);
4715
4722
  }
4716
4723
  function fe(a, t) {
4717
- const e = z(a);
4724
+ const e = V(a);
4718
4725
  return e === t || !X(e) || Q(e) ? !1 : k(e).position === "fixed" || fe(e, t);
4719
4726
  }
4720
- function Ni(a, t) {
4727
+ function Fi(a, t) {
4721
4728
  const e = t.get(a);
4722
4729
  if (e)
4723
4730
  return e;
4724
4731
  let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
4725
4732
  const o = k(a).position === "fixed";
4726
- let r = o ? z(a) : a;
4733
+ let r = o ? V(a) : a;
4727
4734
  for (; X(r) && !Q(r); ) {
4728
4735
  const n = k(r), l = Dt(r);
4729
- !l && n.position === "fixed" && (s = null), (o ? !l && !s : !l && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(r) && !l && fe(a, r)) ? i = i.filter((f) => f !== r) : s = n, r = z(r);
4736
+ !l && n.position === "fixed" && (s = null), (o ? !l && !s : !l && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(r) && !l && fe(a, r)) ? i = i.filter((f) => f !== r) : s = n, r = V(r);
4730
4737
  }
4731
4738
  return t.set(a, i), i;
4732
4739
  }
@@ -4737,7 +4744,7 @@ function Yi(a) {
4737
4744
  rootBoundary: i,
4738
4745
  strategy: s
4739
4746
  } = a;
4740
- const r = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], n = r[0], l = r.reduce((h, f) => {
4747
+ const r = [...e === "clippingAncestors" ? wt(t) ? [] : Fi(t, this._c) : [].concat(e), i], n = r[0], l = r.reduce((h, f) => {
4741
4748
  const d = qt(t, f, s);
4742
4749
  return h.top = U(d.top, h.top), h.right = rt(d.right, h.right), h.bottom = rt(d.bottom, h.bottom), h.left = U(d.left, h.left), h;
4743
4750
  }, qt(t, n, s));
@@ -4759,12 +4766,12 @@ function Ki(a) {
4759
4766
  };
4760
4767
  }
4761
4768
  function Bi(a, t, e) {
4762
- const i = N(t), s = K(t), o = e === "fixed", r = ot(a, !0, o, t);
4769
+ const i = F(t), s = K(t), o = e === "fixed", r = ot(a, !0, o, t);
4763
4770
  let n = {
4764
4771
  scrollLeft: 0,
4765
4772
  scrollTop: 0
4766
4773
  };
4767
- const l = V(0);
4774
+ const l = z(0);
4768
4775
  if (i || !i && !o)
4769
4776
  if ((tt(t) !== "body" || lt(s)) && (n = pt(t)), i) {
4770
4777
  const u = ot(t, !0, o, t);
@@ -4788,7 +4795,7 @@ function mt(a) {
4788
4795
  return k(a).position === "static";
4789
4796
  }
4790
4797
  function Gt(a, t) {
4791
- if (!N(a) || k(a).position === "fixed")
4798
+ if (!F(a) || k(a).position === "fixed")
4792
4799
  return null;
4793
4800
  if (t)
4794
4801
  return t(a);
@@ -4799,12 +4806,12 @@ function xe(a, t) {
4799
4806
  const e = H(a);
4800
4807
  if (wt(a))
4801
4808
  return e;
4802
- if (!N(a)) {
4803
- let s = z(a);
4809
+ if (!F(a)) {
4810
+ let s = V(a);
4804
4811
  for (; s && !Q(s); ) {
4805
4812
  if (X(s) && !mt(s))
4806
4813
  return s;
4807
- s = z(s);
4814
+ s = V(s);
4808
4815
  }
4809
4816
  return e;
4810
4817
  }
@@ -4828,7 +4835,7 @@ const Wi = async function(a) {
4828
4835
  function Pi(a) {
4829
4836
  return k(a).direction === "rtl";
4830
4837
  }
4831
- const Vi = {
4838
+ const zi = {
4832
4839
  convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
4833
4840
  getDocumentElement: K,
4834
4841
  getClippingRect: Yi,
@@ -4839,9 +4846,9 @@ const Vi = {
4839
4846
  getScale: Z,
4840
4847
  isElement: X,
4841
4848
  isRTL: Pi
4842
- }, ue = Oi, ge = Si, we = Ii, zi = Ri, pe = (a, t, e) => {
4849
+ }, ue = Oi, ge = Si, we = Ii, Vi = Ri, pe = (a, t, e) => {
4843
4850
  const i = /* @__PURE__ */ new Map(), s = {
4844
- platform: Vi,
4851
+ platform: zi,
4845
4852
  ...e
4846
4853
  }, o = {
4847
4854
  ...s.platform,
@@ -4922,7 +4929,7 @@ let $i = class {
4922
4929
  }
4923
4930
  }, this.floatingEl, {
4924
4931
  placement: t.overflowTooltipPlacement,
4925
- middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
4932
+ middleware: [ge(), we(), ue(6), Vi({ element: this.arrowEl })]
4926
4933
  }).then((n) => {
4927
4934
  const { x: l, y: h, placement: f, middlewareData: d } = n;
4928
4935
  if (Object.assign(this.floatingEl.style, {
@@ -5145,7 +5152,28 @@ class Gi {
5145
5152
  class ji {
5146
5153
  constructor(t) {
5147
5154
  c(this, "ctx");
5148
- this.ctx = t;
5155
+ this.ctx = t, this.ctx.on("scroll", () => {
5156
+ if (!this.ctx.config.ENABLE_HEADER_STICKY)
5157
+ return;
5158
+ const e = this.ctx.targetContainer.getBoundingClientRect();
5159
+ let i = !1, s = this.getHeader();
5160
+ e.top < 0 && e.top < -this.ctx.header.visibleHeight && e.top > -this.ctx.body.visibleHeight ? i = !0 : i = !1;
5161
+ const {
5162
+ config: { CSS_PREFIX: o }
5163
+ } = this.ctx, { visibleWidth: r } = this.ctx.body, n = {
5164
+ type: "header-sticky",
5165
+ class: `${o}-overlayer-header-sticky`,
5166
+ style: {
5167
+ position: "sticky",
5168
+ top: "0px",
5169
+ "z-index": 10,
5170
+ width: `${r}px`,
5171
+ display: i ? "block" : "none"
5172
+ },
5173
+ views: s.views
5174
+ };
5175
+ this.ctx.emit("headerStickyChange", n);
5176
+ });
5149
5177
  }
5150
5178
  draw() {
5151
5179
  const t = this.getContainer();
@@ -5191,8 +5219,8 @@ class ji {
5191
5219
  key: "left",
5192
5220
  style: {
5193
5221
  position: "absolute",
5194
- top: `${0.5}px`,
5195
- left: `${0.5}px`,
5222
+ top: "0px",
5223
+ left: "0px",
5196
5224
  overflow: "hidden",
5197
5225
  width: `${t}px`,
5198
5226
  height: `${r}px`
@@ -5202,10 +5230,10 @@ class ji {
5202
5230
  key: "center",
5203
5231
  style: {
5204
5232
  position: "absolute",
5205
- top: `${0.5}px`,
5233
+ top: "0px",
5206
5234
  left: `${t}px`,
5207
5235
  overflow: "hidden",
5208
- width: `${o - t - d}px`,
5236
+ width: `${o - t - d + 1}px`,
5209
5237
  height: `${r}px`
5210
5238
  },
5211
5239
  cells: l
@@ -5213,10 +5241,10 @@ class ji {
5213
5241
  key: "right",
5214
5242
  style: {
5215
5243
  position: "absolute",
5216
- top: `${0.5}px`,
5217
- right: `${0.5}px`,
5244
+ top: "0px",
5245
+ right: "0px",
5218
5246
  overflow: "hidden",
5219
- width: `${d}px`,
5247
+ width: `${d + 1}px`,
5220
5248
  height: `${r}px`
5221
5249
  },
5222
5250
  cells: f