bkui-vue 0.0.2-beta.16 → 0.0.2-beta.18

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.
@@ -5855,6 +5855,21 @@ class BKZIndexManager {
5855
5855
  }
5856
5856
  const bkZIndexManager = new BKZIndexManager();
5857
5857
  `__bk_mask_${random(16)}`;
5858
+ const MaskEventMap = /* @__PURE__ */ new WeakMap();
5859
+ const getMaskEvent = (mask) => {
5860
+ if (MaskEventMap.has(mask)) {
5861
+ return MaskEventMap.get(mask);
5862
+ }
5863
+ return [];
5864
+ };
5865
+ const setMaskEvent = (mask, event, args, content, instanceId) => {
5866
+ const maskEvent = getMaskEvent(mask);
5867
+ if (maskEvent.some((evet) => evet.instanceId === instanceId)) {
5868
+ return;
5869
+ }
5870
+ maskEvent.push({ event, args, content, instanceId });
5871
+ MaskEventMap.set(mask, maskEvent);
5872
+ };
5858
5873
  class MaskQueueMaker {
5859
5874
  constructor() {
5860
5875
  __publicField(this, "timer", null);
@@ -5867,11 +5882,7 @@ class MaskQueueMaker {
5867
5882
  }
5868
5883
  pushMaskStyle(parentNode, style2) {
5869
5884
  const value = this.getMaskMap(parentNode);
5870
- if (!(value == null ? void 0 : value.styles)) {
5871
- this.setMaskMap(parentNode, { styles: [style2], ...value || {} });
5872
- } else {
5873
- value.styles.push(style2);
5874
- }
5885
+ this.setMaskMap(parentNode, { styles: [style2], ...value || {} });
5875
5886
  }
5876
5887
  getMaskStyles(parentNode) {
5877
5888
  var _a;
@@ -5942,26 +5953,30 @@ class BkMaskManager {
5942
5953
  display: "none",
5943
5954
  "background-color": "rgba(0,0,0,.6)"
5944
5955
  });
5945
- __publicField(this, "onClick");
5946
5956
  // 用于判定是否已经初始化过当前实例
5947
5957
  __publicField(this, "isInit", false);
5948
5958
  __publicField(this, "maskAttrTag", "auto");
5949
- __publicField(this, "popInstance");
5950
- const { multiInstance = false, maskAttrTag = "auto", parentNode = document.body, maskStyle = {}, onClick = null, popInstance = null } = config || {};
5959
+ const {
5960
+ multiInstance = false,
5961
+ maskAttrTag = "auto",
5962
+ parentNode = document.body,
5963
+ maskStyle = {}
5964
+ } = config || {};
5951
5965
  this.parentNode = parentNode || document;
5952
5966
  this.maskAttrTag = maskAttrTag;
5953
- this.onClick = onClick;
5954
5967
  this.activeInstance = void 0;
5955
5968
  this.multiInstance = multiInstance;
5956
- this.popInstance = popInstance;
5957
5969
  this.uniqueMaskAttrTag = this.getMaskAttrTag(maskAttrTag);
5958
5970
  bkMaskMaker.appendMaker(() => {
5959
5971
  this.initInstance(maskStyle);
5960
5972
  });
5961
5973
  }
5962
5974
  setOption(option) {
5963
- const { parentNode = document.body, maskStyle = {}, onClick = null, maskAttrTag = this.maskAttrTag } = option || {};
5964
- this.onClick = onClick;
5975
+ const {
5976
+ parentNode = document.body,
5977
+ maskStyle = {},
5978
+ maskAttrTag = this.maskAttrTag
5979
+ } = option || {};
5965
5980
  this.parentNode = parentNode || document;
5966
5981
  this.setMaskStyle(Object.assign({}, this.maskStyle, maskStyle));
5967
5982
  this.uniqueMaskAttrTag = this.getMaskAttrTag(maskAttrTag);
@@ -5974,7 +5989,7 @@ class BkMaskManager {
5974
5989
  * @param appendStyle 追加样式
5975
5990
  * @param transfer 是否显示将内容加入遮罩下
5976
5991
  */
5977
- show(content, zIndex, showMask = true, appendStyle = {}, uuid2 = null, transfer2 = false) {
5992
+ show(content, zIndex, showMask = true, appendStyle = {}, uuid2 = null, transfer2 = false, onMaskClick, instanceId) {
5978
5993
  const uid = uuid2 ?? random(16);
5979
5994
  const localZIndex = /-?\d+/.test(`${zIndex}`) ? zIndex : bkZIndexManager.getModalNextIndex();
5980
5995
  let style2 = Object.assign({}, this.maskStyle, appendStyle || {});
@@ -5998,7 +6013,9 @@ class BkMaskManager {
5998
6013
  "pointer-events": "all"
5999
6014
  });
6000
6015
  this.initInstance(style2);
6001
- this.catchClickEvent();
6016
+ if (onMaskClick) {
6017
+ this.catchClickEvent(content, onMaskClick, instanceId);
6018
+ }
6002
6019
  this.setMaskStyle(style2);
6003
6020
  bkMaskMaker.pushMaskStyle(this.parentNode, { ...style2 });
6004
6021
  this.backupMask.style.setProperty("z-index", `${localZIndex - 1}`);
@@ -6055,17 +6072,20 @@ class BkMaskManager {
6055
6072
  }
6056
6073
  }
6057
6074
  backupContentElement(content) {
6058
- content && this.backupMask.append(content);
6075
+ var _a;
6076
+ content && ((_a = this.backupMask) == null ? void 0 : _a.append(content));
6059
6077
  }
6060
6078
  getActiveContentInstance() {
6061
6079
  return this.activeInstance;
6062
6080
  }
6081
+ removeClickEvent() {
6082
+ }
6063
6083
  initInstance(maskStyle) {
6064
6084
  if (!this.isInit) {
6065
6085
  this.isInit = true;
6086
+ this.backupMask = this.getBackupMask();
6066
6087
  const { instance, isExist } = this.getMask();
6067
6088
  this.mask = instance;
6068
- this.backupMask = this.getBackupMask();
6069
6089
  !isExist && this.setMaskStyle(Object.assign({}, this.maskStyle, maskStyle));
6070
6090
  }
6071
6091
  }
@@ -6082,26 +6102,31 @@ class BkMaskManager {
6082
6102
  if (!div) {
6083
6103
  isExist = false;
6084
6104
  div = this.createMask();
6105
+ div.addEventListener(
6106
+ "click",
6107
+ (e3) => this.handleMaskClick(e3),
6108
+ true
6109
+ );
6085
6110
  }
6086
6111
  return {
6087
6112
  instance: div,
6088
6113
  isExist
6089
6114
  };
6090
6115
  }
6091
- catchClickEvent() {
6092
- if (this.mask) {
6093
- this.mask.addEventListener("click", (e3) => this.handleMaskClick(e3), true);
6094
- }
6095
- }
6096
- removeClickEvent() {
6116
+ catchClickEvent(content, onMaskClick, instanceId) {
6097
6117
  if (this.mask) {
6098
- this.mask.removeEventListener("click", this.handleMaskClick);
6118
+ setMaskEvent(this.mask, onMaskClick, [], content, instanceId);
6099
6119
  }
6100
6120
  }
6101
6121
  handleMaskClick(e3) {
6102
- if (e3.target === this.mask) {
6103
- if (typeof this.onClick === "function") {
6104
- Reflect.apply(this.onClick, this.popInstance || this, [e3]);
6122
+ if (e3.target !== this.mask) {
6123
+ return;
6124
+ }
6125
+ const events = getMaskEvent(this.mask);
6126
+ if (events.length) {
6127
+ const { event } = events.pop();
6128
+ if (typeof event === "function") {
6129
+ event(e3);
6105
6130
  }
6106
6131
  }
6107
6132
  }
@@ -6147,23 +6172,34 @@ class BkMaskManager {
6147
6172
  }
6148
6173
  }
6149
6174
  new BkMaskManager({});
6175
+ const popInstanceStore = /* @__PURE__ */ new WeakMap();
6150
6176
  class BKPopIndexManager {
6151
- // private instanceUUID;
6152
6177
  constructor(options) {
6153
6178
  /** 用来缓存弹出层实例 */
6154
- __publicField(this, "popInstanceList");
6155
6179
  __publicField(this, "uuidAttrName");
6156
6180
  __publicField(this, "clickFn");
6157
6181
  __publicField(this, "bKMaskManagerInstance");
6158
- this.popInstanceList = [];
6182
+ __publicField(this, "transfer");
6183
+ __publicField(this, "uniqId");
6159
6184
  this.clickFn = void 0;
6160
6185
  this.uuidAttrName = "data-bk-pop-uuid";
6186
+ this.uniqId = random(16);
6187
+ this.transfer = this.getParentNode(options == null ? void 0 : options.transfer);
6161
6188
  this.bKMaskManagerInstance = new BkMaskManager({
6162
6189
  parentNode: this.getParentNode(options == null ? void 0 : options.transfer),
6163
6190
  popInstance: this,
6164
6191
  onClick: this.onMaskClickFn
6165
6192
  });
6166
6193
  }
6194
+ get popInstanceList() {
6195
+ if (!popInstanceStore.has(this.transfer)) {
6196
+ popInstanceStore.set(this.transfer, []);
6197
+ }
6198
+ return popInstanceStore.get(this.transfer);
6199
+ }
6200
+ set popInstanceList(val) {
6201
+ popInstanceStore.set(this.transfer, val);
6202
+ }
6167
6203
  getParentNode(transfer2) {
6168
6204
  if (typeof transfer2 === "string") {
6169
6205
  const target = document.querySelector(transfer2);
@@ -6187,7 +6223,7 @@ class BKPopIndexManager {
6187
6223
  * @param transfer 是否显示在body内(即是否显示在div#app内,默认为false)
6188
6224
  * @returns
6189
6225
  */
6190
- show(content, showMask = true, appendStyle = {}, transfer2 = false, zindex = void 0) {
6226
+ show(content, showMask = true, appendStyle = {}, transfer2 = false, zindex = void 0, onMaskClick) {
6191
6227
  if (!content) {
6192
6228
  console.warn("pop show error: content is null or undefined");
6193
6229
  return;
@@ -6195,9 +6231,20 @@ class BKPopIndexManager {
6195
6231
  const zIndex = typeof zindex === "number" ? zindex : bkZIndexManager.getModalNextIndex();
6196
6232
  const uuid2 = random(16);
6197
6233
  content.setAttribute(this.uuidAttrName, uuid2);
6234
+ if (this.popInstanceList.length > 0) {
6235
+ showMask && this.bKMaskManagerInstance.backupContentElement(this.popInstanceList.slice(-1)[0].content);
6236
+ }
6198
6237
  this.popInstanceList.push({ uuid: uuid2, zIndex, content, showMask, appendStyle });
6199
- showMask && this.bKMaskManagerInstance.backupActiveInstance();
6200
- this.bKMaskManagerInstance.show(content, zIndex, showMask, appendStyle, uuid2, transfer2);
6238
+ this.bKMaskManagerInstance.show(
6239
+ content,
6240
+ zIndex,
6241
+ showMask,
6242
+ appendStyle,
6243
+ uuid2,
6244
+ transfer2,
6245
+ onMaskClick,
6246
+ this.uniqId
6247
+ );
6201
6248
  }
6202
6249
  /**
6203
6250
  * 销毁指定实例
@@ -6222,7 +6269,13 @@ class BKPopIndexManager {
6222
6269
  if (this.popInstanceList.length) {
6223
6270
  const activeItem = this.popInstanceList.slice(-1)[0];
6224
6271
  const { zIndex, content, showMask, appendStyle, uuid: uuid2 } = activeItem;
6225
- this.bKMaskManagerInstance.show(content, zIndex, showMask, appendStyle, uuid2);
6272
+ this.bKMaskManagerInstance.show(
6273
+ content,
6274
+ zIndex,
6275
+ showMask,
6276
+ appendStyle,
6277
+ uuid2
6278
+ );
6226
6279
  } else {
6227
6280
  this.bKMaskManagerInstance.hide();
6228
6281
  }
@@ -6250,6 +6303,7 @@ class BKPopIndexManager {
6250
6303
  } else {
6251
6304
  content == null ? void 0 : content.remove();
6252
6305
  }
6306
+ this.bKMaskManagerInstance.removeClickEvent();
6253
6307
  }
6254
6308
  onMaskClickFn(e3) {
6255
6309
  if (this.clickFn) {
@@ -13232,7 +13286,6 @@ const usePopperId = (props2, prefix = "#") => {
13232
13286
  if (!/^body$/i.test(props2.boundary)) {
13233
13287
  if (typeof props2.boundary === "string") {
13234
13288
  if (!isAvailableId(props2.boundary)) {
13235
- console.error("props.boundary is not available selector");
13236
13289
  resolvedBoundary = "body";
13237
13290
  return;
13238
13291
  }
@@ -15489,14 +15542,13 @@ const Component$t = /* @__PURE__ */ defineComponent({
15489
15542
  var _a, _b;
15490
15543
  if (val) {
15491
15544
  this.$nextTick(() => {
15492
- this.bkPopIndexManager.onMaskClick((_e) => {
15493
- this.handleClickOutSide();
15494
- }, this.$el);
15495
15545
  const hideMaskStyle = {
15496
15546
  "background-color": "rgba(0,0,0,0)"
15497
15547
  };
15498
15548
  const appendStyle = this.showMask ? {} : hideMaskStyle;
15499
- this.bkPopIndexManager.show(this.$el, this.showMask, appendStyle, !!this.transfer, this.zIndex);
15549
+ this.bkPopIndexManager.show(this.$el, this.showMask, appendStyle, !!this.transfer, this.zIndex, (_e) => {
15550
+ this.handleClickOutSide();
15551
+ });
15500
15552
  this.$emit("shown");
15501
15553
  });
15502
15554
  } else {
@@ -18638,6 +18690,7 @@ const Component$j = /* @__PURE__ */ defineComponent({
18638
18690
  emit
18639
18691
  }) {
18640
18692
  const handleClose = async () => {
18693
+ console.log("slider handleClose");
18641
18694
  let shouldClose = true;
18642
18695
  if (typeof props2.beforeClose === "function") {
18643
18696
  shouldClose = await props2.beforeClose();
@@ -21195,7 +21248,6 @@ const HeadFilter = /* @__PURE__ */ defineComponent({
21195
21248
  setup(props2, {
21196
21249
  emit
21197
21250
  }) {
21198
- var _a;
21199
21251
  const {
21200
21252
  resolveClassName: resolveClassName2
21201
21253
  } = usePrefix();
@@ -21206,7 +21258,10 @@ const HeadFilter = /* @__PURE__ */ defineComponent({
21206
21258
  const {
21207
21259
  filter
21208
21260
  } = toRefs(props2.column);
21209
- const checked = ref(((_a = filter.value) == null ? void 0 : _a.checked) ?? []);
21261
+ const checked = computed(() => {
21262
+ var _a;
21263
+ return ((_a = filter.value) == null ? void 0 : _a.checked) ?? [];
21264
+ });
21210
21265
  const state = reactive({
21211
21266
  isOpen: false,
21212
21267
  checked: checked.value
@@ -21692,7 +21747,7 @@ const useFixedColumn = (props2, colgroups, hasScrollY) => {
21692
21747
  }
21693
21748
  const fixedOffset = {
21694
21749
  left: 0,
21695
- right: hasScrollY2 ? SCROLLY_WIDTH : 0
21750
+ right: hasScrollY2 ? SCROLLY_WIDTH : -1
21696
21751
  };
21697
21752
  const fixedPos = resolveFixColPos(column);
21698
21753
  fixedOffset[fixedPos] = getPreColumnOffset(fixedPos, column, fixedOffset[fixedPos]);
@@ -21748,12 +21803,13 @@ class TableRender {
21748
21803
  }
21749
21804
  return resolvePropVal(this.props, "rowHeight", ["tbody", row, rowIndex]);
21750
21805
  });
21751
- __publicField(this, "getColumnClass", (column, colIndex) => [{
21806
+ __publicField(this, "getColumnClass", (column, colIndex) => ({
21752
21807
  [`${this.uuid}-column-${colIndex}`]: true,
21753
21808
  column_fixed: !!column.fixed,
21754
21809
  column_fixed_left: !!column.fixed,
21755
- column_fixed_right: column.fixed === "right"
21756
- }, column.className]);
21810
+ column_fixed_right: column.fixed === "right",
21811
+ [`${column.className}`]: true
21812
+ }));
21757
21813
  __publicField(this, "getHeadColumnClass", (column, colIndex) => ({
21758
21814
  ...this.getColumnClass(column, colIndex),
21759
21815
  active: this.isColActive(colIndex)
@@ -22059,13 +22115,16 @@ class TableRender {
22059
22115
  return createVNode(Fragment, null, [createVNode("thead", {
22060
22116
  "style": rowStyle
22061
22117
  }, [createVNode(TableRow, null, {
22062
- default: () => [createVNode("tr", null, [this.filterColGroups.map((column, index2) => createVNode("th", mergeProps({
22063
- "colspan": 1,
22064
- "rowspan": 1,
22065
- "class": [this.getHeadColumnClass(column, index2), this.getColumnCustomClass(column), column.align || this.props.headerAlign || this.props.align],
22066
- "style": resolveFixedColumnStyle(column, this.styleRef.value.hasScrollY),
22067
- "onClick": () => this.handleColumnHeadClick(index2, column)
22068
- }, resolveEventListener(column)), [renderHeadCell(column, index2)])), getScrollFix()])]
22118
+ default: () => [createVNode("tr", null, [this.filterColGroups.map((column, index2) => {
22119
+ console.log("getHeadColumnClass", column, index2, this.getHeadColumnClass(column, index2));
22120
+ return createVNode("th", mergeProps({
22121
+ "colspan": 1,
22122
+ "rowspan": 1,
22123
+ "class": [this.getHeadColumnClass(column, index2), this.getColumnCustomClass(column), column.align || this.props.headerAlign || this.props.align],
22124
+ "style": resolveFixedColumnStyle(column, this.styleRef.value.hasScrollY),
22125
+ "onClick": () => this.handleColumnHeadClick(index2, column)
22126
+ }, resolveEventListener(column)), [renderHeadCell(column, index2)]);
22127
+ }), getScrollFix()])]
22069
22128
  })])]);
22070
22129
  }
22071
22130
  /**
@@ -22590,15 +22649,6 @@ const useClass = (props2, targetColumns, root, reactiveProp, pageData) => {
22590
22649
  "has-settings": !!props2.settings
22591
22650
  });
22592
22651
  const resolvedColumns = computed(() => getColumns());
22593
- const offsetXVarStyle = computed(() => ({
22594
- "--var-scroll-left": `${reactiveProp.scrollTranslateX}px`,
22595
- "--var-scroll-top": `${reactiveProp.scrollTranslateY}px`
22596
- }));
22597
- const headOffsetXVarStyle = computed(() => ({
22598
- "--var-scroll-left": `${reactiveProp.scrollTranslateX}px`,
22599
- "--var-scroll-top": "0px",
22600
- right: hasScrollYRef.value ? `${SCROLLY_WIDTH - 2}px` : "0px"
22601
- }));
22602
22652
  const config = resolveHeadConfig(props2);
22603
22653
  const headStyle = computed(() => ({
22604
22654
  "--row-height": `${resolvePropVal(config, "height", ["thead"])}px`,
@@ -22712,8 +22762,6 @@ const useClass = (props2, targetColumns, root, reactiveProp, pageData) => {
22712
22762
  wrapperStyle,
22713
22763
  contentStyle,
22714
22764
  headStyle,
22715
- offsetXVarStyle,
22716
- headOffsetXVarStyle,
22717
22765
  resetTableHeight,
22718
22766
  updateBorderClass,
22719
22767
  getColumnsWidthOffsetWidth,
@@ -23130,8 +23178,6 @@ const Component$f = /* @__PURE__ */ defineComponent({
23130
23178
  contentStyle,
23131
23179
  headStyle,
23132
23180
  hasScrollYRef,
23133
- offsetXVarStyle,
23134
- headOffsetXVarStyle,
23135
23181
  updateBorderClass,
23136
23182
  resetTableHeight,
23137
23183
  getColumnsWidthOffsetWidth,
@@ -23312,8 +23358,9 @@ const Component$f = /* @__PURE__ */ defineComponent({
23312
23358
  if (!root.value) {
23313
23359
  return;
23314
23360
  }
23315
- if (props2.height === "100%" || props2.height === "auto")
23316
- ;
23361
+ if (props2.height === "100%" || props2.height === "auto") {
23362
+ resetTableHeight(root.value);
23363
+ }
23317
23364
  updateBorderClass(root.value);
23318
23365
  const offset2 = getColumnsWidthOffsetWidth();
23319
23366
  resolveColumnWidth(root.value, colgroups, 20, offset2);
@@ -23373,6 +23420,10 @@ const Component$f = /* @__PURE__ */ defineComponent({
23373
23420
  const footerStyle = computed(() => ({
23374
23421
  "--footer-height": hasFooter.value ? `${props2.paginationHeight}px` : "0"
23375
23422
  }));
23423
+ const fixedContainerStyle = computed(() => ({
23424
+ right: hasScrollYRef.value ? `${SCROLLY_WIDTH}px` : 0,
23425
+ ...footerStyle.value
23426
+ }));
23376
23427
  const {
23377
23428
  renderScrollLoading
23378
23429
  } = useScrollLoading(props2, ctx);
@@ -23387,25 +23438,6 @@ const Component$f = /* @__PURE__ */ defineComponent({
23387
23438
  zIndex: 2,
23388
23439
  ...props2.prependStyle || {}
23389
23440
  }));
23390
- const renderFixedColumns = () => fixedColumns.value.map(({
23391
- isExist,
23392
- colPos,
23393
- column
23394
- }) => isExist ? "" : createVNode("div", {
23395
- "class": resolveColumnClass(column, reactiveSchema.scrollTranslateX, tableOffsetRight.value),
23396
- "style": resolveColumnStyle(colPos)
23397
- }, null));
23398
- const renderBodyAppend = () => createVNode(Fragment, null, [createVNode("div", {
23399
- "class": fixedBottomBorder.value
23400
- }, null), createVNode("div", {
23401
- "class": fixedWrapperClass,
23402
- "style": offsetXVarStyle.value
23403
- }, [renderFixedColumns(), createVNode("div", {
23404
- "class": resizeColumnClass,
23405
- "style": resizeColumnStyle.value
23406
- }, null), createVNode("div", {
23407
- "class": loadingRowClass
23408
- }, [renderScrollLoading()])])]);
23409
23441
  const renderPrepend = () => {
23410
23442
  if (ctx.slots.prepend) {
23411
23443
  return createVNode("div", {
@@ -23426,10 +23458,7 @@ const Component$f = /* @__PURE__ */ defineComponent({
23426
23458
  createVNode("div", {
23427
23459
  "class": headClass,
23428
23460
  "style": headStyle.value
23429
- }, [[tableRender.renderTableHeadSchema(), createVNode("div", {
23430
- "class": fixedWrapperClass,
23431
- "style": headOffsetXVarStyle.value
23432
- }, [renderFixedColumns()])]]),
23461
+ }, [tableRender.renderTableHeadSchema()]),
23433
23462
  createVNode(BkVirtualRender, mergeProps({
23434
23463
  "ref": refVirtualRender,
23435
23464
  "lineHeight": tableRender.getRowHeight,
@@ -23447,8 +23476,26 @@ const Component$f = /* @__PURE__ */ defineComponent({
23447
23476
  }), {
23448
23477
  beforeContent: () => renderPrepend(),
23449
23478
  default: (scope) => tableRender.renderTableBodySchema(scope.data || pageData),
23450
- afterSection: () => renderBodyAppend()
23479
+ afterSection: () => createVNode("div", {
23480
+ "class": fixedBottomBorder.value
23481
+ }, null)
23451
23482
  }),
23483
+ createVNode("div", {
23484
+ "class": fixedWrapperClass,
23485
+ "style": fixedContainerStyle.value
23486
+ }, [fixedColumns.value.map(({
23487
+ isExist,
23488
+ colPos,
23489
+ column
23490
+ }) => isExist ? "" : createVNode("div", {
23491
+ "class": resolveColumnClass(column, reactiveSchema.scrollTranslateX, tableOffsetRight.value),
23492
+ "style": resolveColumnStyle(colPos)
23493
+ }, null)), createVNode("div", {
23494
+ "class": resizeColumnClass,
23495
+ "style": resizeColumnStyle.value
23496
+ }, null), createVNode("div", {
23497
+ "class": loadingRowClass
23498
+ }, [renderScrollLoading()])]),
23452
23499
  createVNode("div", {
23453
23500
  "class": footerClass.value,
23454
23501
  "style": footerStyle.value
@@ -26144,9 +26191,13 @@ const MessageConstructor = /* @__PURE__ */ defineComponent({
26144
26191
  offsetWidth,
26145
26192
  offsetTop
26146
26193
  } = e3.trigger;
26194
+ const msgTree = e3.trigger.closest(".message-tree");
26195
+ const msgTreeScrollTop = msgTree ? msgTree.scrollTop : 0;
26147
26196
  target.classList.remove(...["success", "error", "is-hidden"]);
26148
26197
  target.classList.add(...[theme, "is-show"]);
26149
- target.style.setProperty("transform", `translate(${offsetLeft + offsetWidth / 2 - 41}px, ${offsetTop - 40}px`);
26198
+ const transX = offsetLeft + offsetWidth / 2 - 41;
26199
+ const transY = offsetTop - msgTreeScrollTop - 40;
26200
+ target.style.setProperty("transform", `translate(${transX}px, ${transY}px`);
26150
26201
  copyStatusTimer && clearTimeout(copyStatusTimer);
26151
26202
  copyStatusTimer = setTimeout(() => {
26152
26203
  target.classList.remove(...["is-show"]);