@uzum-tech/ui 1.10.1 → 1.11.0

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 (85) hide show
  1. package/dist/index.js +1151 -147
  2. package/dist/index.prod.js +3 -3
  3. package/es/_internal/index.d.ts +2 -0
  4. package/es/_internal/index.js +1 -0
  5. package/es/_internal/safe-top-scrollbar/index.d.ts +2 -0
  6. package/es/_internal/safe-top-scrollbar/index.js +1 -0
  7. package/es/_internal/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +356 -0
  8. package/es/_internal/safe-top-scrollbar/src/SafeTopScrollbar.js +708 -0
  9. package/es/_internal/safe-top-scrollbar/src/styles/index.cssr.d.ts +2 -0
  10. package/es/_internal/safe-top-scrollbar/src/styles/index.cssr.js +80 -0
  11. package/es/_internal/safe-top-scrollbar/src/styles/rtl.cssr.d.ts +2 -0
  12. package/es/_internal/safe-top-scrollbar/src/styles/rtl.cssr.js +10 -0
  13. package/es/_internal/safe-top-scrollbar/styles/common.d.ts +7 -0
  14. package/es/_internal/safe-top-scrollbar/styles/common.js +7 -0
  15. package/es/_internal/safe-top-scrollbar/styles/dark.d.ts +3 -0
  16. package/es/_internal/safe-top-scrollbar/styles/dark.js +8 -0
  17. package/es/_internal/safe-top-scrollbar/styles/index.d.ts +4 -0
  18. package/es/_internal/safe-top-scrollbar/styles/index.js +3 -0
  19. package/es/_internal/safe-top-scrollbar/styles/light.d.ts +18 -0
  20. package/es/_internal/safe-top-scrollbar/styles/light.js +12 -0
  21. package/es/_internal/safe-top-scrollbar/styles/rtl.d.ts +3 -0
  22. package/es/_internal/safe-top-scrollbar/styles/rtl.js +6 -0
  23. package/es/chat/src/Chat.d.ts +14 -1
  24. package/es/chat/src/Chat.js +5 -0
  25. package/es/chat/src/ChatParts/ChatAttachment.js +31 -3
  26. package/es/chat/src/ChatParts/MainArea.js +37 -41
  27. package/es/chat/src/interface.d.ts +6 -2
  28. package/es/components.d.ts +1 -0
  29. package/es/components.js +1 -0
  30. package/es/config-provider/src/internal-interface.d.ts +2 -0
  31. package/es/drawer/src/Drawer.d.ts +18 -0
  32. package/es/drawer/src/Drawer.js +28 -26
  33. package/es/drawer/src/DrawerBodyWrapper.d.ts +8 -0
  34. package/es/drawer/src/DrawerBodyWrapper.js +36 -8
  35. package/es/safe-top-scrollbar/index.d.ts +2 -0
  36. package/es/safe-top-scrollbar/index.js +1 -0
  37. package/es/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +177 -0
  38. package/es/safe-top-scrollbar/src/SafeTopScrollbar.js +38 -0
  39. package/es/themes/dark.js +2 -0
  40. package/es/themes/light.js +2 -0
  41. package/es/version.d.ts +1 -1
  42. package/es/version.js +1 -1
  43. package/lib/_internal/index.d.ts +2 -0
  44. package/lib/_internal/index.js +4 -1
  45. package/lib/_internal/safe-top-scrollbar/index.d.ts +2 -0
  46. package/lib/_internal/safe-top-scrollbar/index.js +9 -0
  47. package/lib/_internal/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +356 -0
  48. package/lib/_internal/safe-top-scrollbar/src/SafeTopScrollbar.js +714 -0
  49. package/lib/_internal/safe-top-scrollbar/src/styles/index.cssr.d.ts +2 -0
  50. package/lib/_internal/safe-top-scrollbar/src/styles/index.cssr.js +85 -0
  51. package/lib/_internal/safe-top-scrollbar/src/styles/rtl.cssr.d.ts +2 -0
  52. package/lib/_internal/safe-top-scrollbar/src/styles/rtl.cssr.js +15 -0
  53. package/lib/_internal/safe-top-scrollbar/styles/common.d.ts +7 -0
  54. package/lib/_internal/safe-top-scrollbar/styles/common.js +10 -0
  55. package/lib/_internal/safe-top-scrollbar/styles/dark.d.ts +3 -0
  56. package/lib/_internal/safe-top-scrollbar/styles/dark.js +10 -0
  57. package/lib/_internal/safe-top-scrollbar/styles/index.d.ts +4 -0
  58. package/lib/_internal/safe-top-scrollbar/styles/index.js +12 -0
  59. package/lib/_internal/safe-top-scrollbar/styles/light.d.ts +18 -0
  60. package/lib/_internal/safe-top-scrollbar/styles/light.js +16 -0
  61. package/lib/_internal/safe-top-scrollbar/styles/rtl.d.ts +3 -0
  62. package/lib/_internal/safe-top-scrollbar/styles/rtl.js +12 -0
  63. package/lib/chat/src/Chat.d.ts +14 -1
  64. package/lib/chat/src/Chat.js +5 -0
  65. package/lib/chat/src/ChatParts/ChatAttachment.js +30 -2
  66. package/lib/chat/src/ChatParts/MainArea.js +37 -41
  67. package/lib/chat/src/interface.d.ts +6 -2
  68. package/lib/components.d.ts +1 -0
  69. package/lib/components.js +1 -0
  70. package/lib/config-provider/src/internal-interface.d.ts +2 -0
  71. package/lib/drawer/src/Drawer.d.ts +18 -0
  72. package/lib/drawer/src/Drawer.js +28 -26
  73. package/lib/drawer/src/DrawerBodyWrapper.d.ts +8 -0
  74. package/lib/drawer/src/DrawerBodyWrapper.js +36 -8
  75. package/lib/safe-top-scrollbar/index.d.ts +2 -0
  76. package/lib/safe-top-scrollbar/index.js +9 -0
  77. package/lib/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +177 -0
  78. package/lib/safe-top-scrollbar/src/SafeTopScrollbar.js +41 -0
  79. package/lib/themes/dark.js +5 -0
  80. package/lib/themes/light.js +5 -0
  81. package/lib/version.d.ts +1 -1
  82. package/lib/version.js +1 -1
  83. package/package.json +1 -1
  84. package/volar.d.ts +1 -0
  85. package/web-types.json +58 -2
package/dist/index.js CHANGED
@@ -3431,7 +3431,7 @@
3431
3431
  }
3432
3432
 
3433
3433
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
3434
- const style$1M = c([c('.v-binder-follower-container', {
3434
+ const style$1N = c([c('.v-binder-follower-container', {
3435
3435
  position: 'absolute',
3436
3436
  left: '0',
3437
3437
  right: '0',
@@ -3510,7 +3510,7 @@
3510
3510
  }
3511
3511
  });
3512
3512
  const ssrAdapter = useSsrAdapter();
3513
- style$1M.mount({
3513
+ style$1N.mount({
3514
3514
  id: 'vueuc/binder',
3515
3515
  head: true,
3516
3516
  anchorMetaName: cssrAnchorMetaName$1,
@@ -4970,7 +4970,7 @@
4970
4970
 
4971
4971
  /* eslint-disable @typescript-eslint/strict-boolean-expressions */
4972
4972
  const hiddenAttr = 'v-hidden';
4973
- const style$1L = c('[v-hidden]', {
4973
+ const style$1M = c('[v-hidden]', {
4974
4974
  display: 'none!important'
4975
4975
  });
4976
4976
  var VOverflow = vue.defineComponent({
@@ -5083,7 +5083,7 @@
5083
5083
  }
5084
5084
  }
5085
5085
  const ssrAdapter = useSsrAdapter();
5086
- style$1L.mount({
5086
+ style$1M.mount({
5087
5087
  id: 'vueuc/overflow',
5088
5088
  head: true,
5089
5089
  anchorMetaName: cssrAnchorMetaName$1,
@@ -28838,7 +28838,7 @@
28838
28838
  };
28839
28839
  }
28840
28840
 
28841
- var style$1K = cB("affix", [cM("affixed", {
28841
+ var style$1L = cB("affix", [cM("affixed", {
28842
28842
  position: "fixed"
28843
28843
  }, [cM("absolute-positioned", {
28844
28844
  position: "absolute"
@@ -28898,7 +28898,7 @@
28898
28898
  props: affixProps,
28899
28899
  setup(props) {
28900
28900
  const { mergedClsPrefixRef } = useConfig(props);
28901
- useStyle("-affix", style$1K, mergedClsPrefixRef);
28901
+ useStyle("-affix", style$1L, mergedClsPrefixRef);
28902
28902
  let scrollTarget = null;
28903
28903
  const stickToTopRef = vue.ref(false);
28904
28904
  const stickToBottomRef = vue.ref(false);
@@ -30104,7 +30104,7 @@
30104
30104
  }
30105
30105
  });
30106
30106
 
30107
- var style$1J = cB("base-icon", `
30107
+ var style$1K = cB("base-icon", `
30108
30108
  height: 1em;
30109
30109
  width: 1em;
30110
30110
  line-height: 1em;
@@ -30140,7 +30140,7 @@
30140
30140
  onMouseup: Function
30141
30141
  },
30142
30142
  setup(props) {
30143
- useStyle("-base-icon", style$1J, vue.toRef(props, "clsPrefix"));
30143
+ useStyle("-base-icon", style$1K, vue.toRef(props, "clsPrefix"));
30144
30144
  },
30145
30145
  render() {
30146
30146
  return /* @__PURE__ */ vue.h(
@@ -30160,7 +30160,7 @@
30160
30160
  }
30161
30161
  });
30162
30162
 
30163
- var style$1I = cB("base-close", `
30163
+ var style$1J = cB("base-close", `
30164
30164
  display: flex;
30165
30165
  align-items: center;
30166
30166
  justify-content: center;
@@ -30232,7 +30232,7 @@
30232
30232
  absolute: Boolean
30233
30233
  },
30234
30234
  setup(props) {
30235
- useStyle("-base-close", style$1I, vue.toRef(props, "clsPrefix"));
30235
+ useStyle("-base-close", style$1J, vue.toRef(props, "clsPrefix"));
30236
30236
  return () => {
30237
30237
  const { clsPrefix, disabled, absolute, round, isButtonTag } = props;
30238
30238
  const Tag = isButtonTag ? "button" : "div";
@@ -30312,7 +30312,7 @@
30312
30312
  })];
30313
30313
  }
30314
30314
 
30315
- var style$1H = c$1([c$1("@keyframes loading-container-rotate", `
30315
+ var style$1I = c$1([c$1("@keyframes loading-container-rotate", `
30316
30316
  to {
30317
30317
  -webkit-transform: rotate(360deg);
30318
30318
  transform: rotate(360deg);
@@ -30482,7 +30482,7 @@
30482
30482
  ...exposedLoadingProps
30483
30483
  },
30484
30484
  setup(props) {
30485
- useStyle("-base-loading", style$1H, vue.toRef(props, "clsPrefix"));
30485
+ useStyle("-base-loading", style$1I, vue.toRef(props, "clsPrefix"));
30486
30486
  },
30487
30487
  render() {
30488
30488
  const { clsPrefix, radius, strokeWidth, stroke, scale } = this;
@@ -30729,7 +30729,7 @@
30729
30729
  shadowDepth: "0px 8px 8px 0px rgba(0, 0, 0, 0.25)"
30730
30730
  };
30731
30731
 
30732
- const self$1q = vars => {
30732
+ const self$1r = vars => {
30733
30733
  const {
30734
30734
  heightSmall,
30735
30735
  heightMedium,
@@ -30750,10 +30750,10 @@
30750
30750
  const skeletonLight$1 = {
30751
30751
  name: "Skeleton",
30752
30752
  common: derived,
30753
- self: self$1q
30753
+ self: self$1r
30754
30754
  };
30755
30755
 
30756
- var style$1G = c$1([cB("skeleton", `
30756
+ var style$1H = c$1([cB("skeleton", `
30757
30757
  height: 1em;
30758
30758
  width: 100%;
30759
30759
  transition: background-color .3s var(--u-bezier);
@@ -30809,7 +30809,7 @@
30809
30809
  const themeRef = useTheme(
30810
30810
  "Skeleton",
30811
30811
  "-skeleton",
30812
- style$1G,
30812
+ style$1H,
30813
30813
  skeletonLight$1,
30814
30814
  props,
30815
30815
  mergedClsPrefixRef
@@ -31558,7 +31558,7 @@
31558
31558
  return treemate;
31559
31559
  }
31560
31560
 
31561
- const self$1p = vars => {
31561
+ const self$1q = vars => {
31562
31562
  const {
31563
31563
  fontBodyMedium,
31564
31564
  fontTitleLarge,
@@ -31590,16 +31590,16 @@
31590
31590
  const emptyLight = {
31591
31591
  name: "Empty",
31592
31592
  common: derived,
31593
- self: self$1p
31593
+ self: self$1q
31594
31594
  };
31595
31595
 
31596
31596
  const emptyDark$1 = {
31597
31597
  name: "Empty",
31598
31598
  common: derived$1,
31599
- self: self$1p
31599
+ self: self$1q
31600
31600
  };
31601
31601
 
31602
- var style$1F = cB("empty", `
31602
+ var style$1G = cB("empty", `
31603
31603
  display: flex;
31604
31604
  flex-direction: column;
31605
31605
  align-items: center;
@@ -31676,7 +31676,7 @@
31676
31676
  const themeRef = useTheme(
31677
31677
  "Empty",
31678
31678
  "-empty",
31679
- style$1F,
31679
+ style$1G,
31680
31680
  emptyLight,
31681
31681
  props,
31682
31682
  mergedClsPrefixRef
@@ -31764,7 +31764,7 @@
31764
31764
  }
31765
31765
  });
31766
31766
 
31767
- const commonVars$a = {
31767
+ const commonVars$b = {
31768
31768
  railInsetHorizontalBottom: "auto 2px 4px 2px",
31769
31769
  railInsetHorizontalTop: "4px 2px auto 2px",
31770
31770
  railInsetVerticalRight: "2px 4px 2px auto",
@@ -31772,7 +31772,7 @@
31772
31772
  railColor: "transparent"
31773
31773
  };
31774
31774
 
31775
- const self$1o = vars => {
31775
+ const self$1p = vars => {
31776
31776
  const {
31777
31777
  scrollbarColor,
31778
31778
  scrollbarColorHover,
@@ -31781,7 +31781,7 @@
31781
31781
  scrollbarBorderRadius
31782
31782
  } = vars;
31783
31783
  return {
31784
- ...commonVars$a,
31784
+ ...commonVars$b,
31785
31785
  height: scrollbarHeight,
31786
31786
  width: scrollbarWidth,
31787
31787
  borderRadius: scrollbarBorderRadius,
@@ -31792,13 +31792,13 @@
31792
31792
  const scrollbarLight = {
31793
31793
  name: "Scrollbar",
31794
31794
  common: derived,
31795
- self: self$1o
31795
+ self: self$1p
31796
31796
  };
31797
31797
 
31798
31798
  const scrollbarDark = {
31799
31799
  name: "Scrollbar",
31800
31800
  common: derived$1,
31801
- self: self$1o
31801
+ self: self$1p
31802
31802
  };
31803
31803
 
31804
31804
  var rtlStyle$s = cB("scrollbar", [cM("rtl", `
@@ -31837,7 +31837,7 @@
31837
31837
  })];
31838
31838
  }
31839
31839
 
31840
- var style$1E = cB("scrollbar", `
31840
+ var style$1F = cB("scrollbar", `
31841
31841
  overflow: hidden;
31842
31842
  position: relative;
31843
31843
  z-index: auto;
@@ -31980,7 +31980,7 @@
31980
31980
  const themeRef = useTheme(
31981
31981
  "Scrollbar",
31982
31982
  "-scrollbar",
31983
- style$1E,
31983
+ style$1F,
31984
31984
  scrollbarLight,
31985
31985
  props,
31986
31986
  mergedClsPrefixRef
@@ -32641,7 +32641,7 @@
32641
32641
  });
32642
32642
  const XScrollbar = Scrollbar$1;
32643
32643
 
32644
- const self$1n = vars => {
32644
+ const self$1o = vars => {
32645
32645
  const {
32646
32646
  borderRadius,
32647
32647
  iconMedium,
@@ -32698,7 +32698,7 @@
32698
32698
  Scrollbar: scrollbarLight,
32699
32699
  Empty: emptyLight
32700
32700
  },
32701
- self: self$1n
32701
+ self: self$1o
32702
32702
  });
32703
32703
 
32704
32704
  const internalSelectMenuDark = {
@@ -32708,10 +32708,10 @@
32708
32708
  Scrollbar: scrollbarDark,
32709
32709
  Empty: emptyDark$1
32710
32710
  },
32711
- self: self$1n
32711
+ self: self$1o
32712
32712
  };
32713
32713
 
32714
- var style$1D = cB("base-account-option", `
32714
+ var style$1E = cB("base-account-option", `
32715
32715
  display: flex;
32716
32716
  align-items: center;
32717
32717
  position: relative;
@@ -32751,7 +32751,7 @@
32751
32751
  font-size: var(--u-avatar-size);
32752
32752
  `)])]);
32753
32753
 
32754
- var commonVars$9 = {
32754
+ var commonVars$a = {
32755
32755
  iconWidth: "44px",
32756
32756
  iconHeight: "44px",
32757
32757
  iconMargin: "0 16px 0 0",
@@ -32763,7 +32763,7 @@
32763
32763
  avatarSize: "16px"
32764
32764
  };
32765
32765
 
32766
- const self$1m = vars => {
32766
+ const self$1n = vars => {
32767
32767
  const {
32768
32768
  heightHuge,
32769
32769
  fontBodyLarge,
@@ -32777,7 +32777,7 @@
32777
32777
  elementsSecondary
32778
32778
  } = vars;
32779
32779
  return {
32780
- ...commonVars$9,
32780
+ ...commonVars$a,
32781
32781
  height: heightHuge,
32782
32782
  labelColor: textSecondary,
32783
32783
  labelFontSize: fontBodyLarge,
@@ -32793,13 +32793,13 @@
32793
32793
  const accountOptionLight = {
32794
32794
  name: "AccountOption",
32795
32795
  common: derived,
32796
- self: self$1m
32796
+ self: self$1n
32797
32797
  };
32798
32798
 
32799
32799
  const accountOptionDark = {
32800
32800
  name: "AccountOption",
32801
32801
  common: derived$1,
32802
- self: self$1m
32802
+ self: self$1n
32803
32803
  };
32804
32804
 
32805
32805
  var UBaseAccountOption = vue.defineComponent({
@@ -32817,7 +32817,7 @@
32817
32817
  const themeRef = useTheme(
32818
32818
  "AccountOption",
32819
32819
  "-base-account-option",
32820
- style$1D,
32820
+ style$1E,
32821
32821
  accountOptionLight,
32822
32822
  props,
32823
32823
  mergedClsPrefixRef
@@ -33121,7 +33121,7 @@
33121
33121
  })];
33122
33122
  }
33123
33123
 
33124
- var style$1C = cB("base-select-menu", `
33124
+ var style$1D = cB("base-select-menu", `
33125
33125
  line-height: 1.5;
33126
33126
  outline: none;
33127
33127
  z-index: 0;
@@ -33306,7 +33306,7 @@
33306
33306
  const themeRef = useTheme(
33307
33307
  "InternalSelectMenu",
33308
33308
  "-internal-select-menu",
33309
- style$1C,
33309
+ style$1D,
33310
33310
  internalSelectMenuLight,
33311
33311
  props,
33312
33312
  vue.toRef(props, "clsPrefix")
@@ -33743,7 +33743,7 @@
33743
33743
  }
33744
33744
  });
33745
33745
 
33746
- var style$1B = cB("base-wave", `
33746
+ var style$1C = cB("base-wave", `
33747
33747
  position: absolute;
33748
33748
  left: 0;
33749
33749
  right: 0;
@@ -33761,7 +33761,7 @@
33761
33761
  }
33762
33762
  },
33763
33763
  setup(props) {
33764
- useStyle("-base-wave", style$1B, vue.toRef(props, "clsPrefix"));
33764
+ useStyle("-base-wave", style$1C, vue.toRef(props, "clsPrefix"));
33765
33765
  const selfRef = vue.ref(null);
33766
33766
  const activeRef = vue.ref(false);
33767
33767
  let animationTimerId = null;
@@ -33806,7 +33806,7 @@
33806
33806
  }
33807
33807
  });
33808
33808
 
33809
- var style$1A = cB("base-menu-mask", `
33809
+ var style$1B = cB("base-menu-mask", `
33810
33810
  position: absolute;
33811
33811
  left: 0;
33812
33812
  right: 0;
@@ -33829,7 +33829,7 @@
33829
33829
  }
33830
33830
  },
33831
33831
  setup(props) {
33832
- useStyle("-base-menu-mask", style$1A, vue.toRef(props, "clsPrefix"));
33832
+ useStyle("-base-menu-mask", style$1B, vue.toRef(props, "clsPrefix"));
33833
33833
  const messageRef = vue.ref(null);
33834
33834
  let timerId = null;
33835
33835
  const uncontrolledShowRef = vue.ref(false);
@@ -33862,7 +33862,7 @@
33862
33862
  }
33863
33863
  });
33864
33864
 
33865
- const self$1l = vars => {
33865
+ const self$1m = vars => {
33866
33866
  const {
33867
33867
  fontBodyMedium,
33868
33868
  containerPrimary,
@@ -33889,13 +33889,13 @@
33889
33889
  const popoverLight = {
33890
33890
  name: "Popover",
33891
33891
  common: derived,
33892
- self: self$1l
33892
+ self: self$1m
33893
33893
  };
33894
33894
 
33895
33895
  const popoverDark = {
33896
33896
  name: "Popover",
33897
33897
  common: derived$1,
33898
- self: self$1l
33898
+ self: self$1m
33899
33899
  };
33900
33900
 
33901
33901
  const oppositePlacement = {
@@ -33905,7 +33905,7 @@
33905
33905
  right: "left"
33906
33906
  };
33907
33907
  const arrowSize = "var(--u-arrow-height) * 1.414";
33908
- var style$1z = c$1([cB("popover", `
33908
+ var style$1A = c$1([cB("popover", `
33909
33909
  transition:
33910
33910
  box-shadow .3s var(--u-bezier),
33911
33911
  background-color .3s var(--u-bezier),
@@ -34096,7 +34096,7 @@
34096
34096
  const themeRef = useTheme(
34097
34097
  "Popover",
34098
34098
  "-popover",
34099
- style$1z,
34099
+ style$1A,
34100
34100
  popoverLight,
34101
34101
  props,
34102
34102
  mergedClsPrefixRef
@@ -34886,7 +34886,7 @@
34886
34886
  }
34887
34887
  });
34888
34888
 
34889
- const self$1k = vars => {
34889
+ const self$1l = vars => {
34890
34890
  const {
34891
34891
  opacityDisabled,
34892
34892
  borderRadiusSmall: borderRadius,
@@ -34984,13 +34984,13 @@
34984
34984
  const tagLight = {
34985
34985
  name: "Tag",
34986
34986
  common: derived,
34987
- self: self$1k
34987
+ self: self$1l
34988
34988
  };
34989
34989
 
34990
34990
  const tagDark = {
34991
34991
  name: "Tag",
34992
34992
  common: derived$1,
34993
- self: self$1k
34993
+ self: self$1l
34994
34994
  };
34995
34995
 
34996
34996
  var rtlStyle$r = cB("tag", [cM("rtl", `
@@ -35037,7 +35037,7 @@
35037
35037
  }
35038
35038
  };
35039
35039
 
35040
- var style$1y = cB("tag", `
35040
+ var style$1z = cB("tag", `
35041
35041
  white-space: nowrap;
35042
35042
  position: relative;
35043
35043
  box-sizing: border-box;
@@ -35204,7 +35204,7 @@
35204
35204
  const themeRef = useTheme(
35205
35205
  "Tag",
35206
35206
  "-tag",
35207
- style$1y,
35207
+ style$1z,
35208
35208
  tagLight,
35209
35209
  props,
35210
35210
  mergedClsPrefixRef
@@ -35563,7 +35563,7 @@
35563
35563
  }
35564
35564
  });
35565
35565
 
35566
- var style$1x = cB("base-clear", `
35566
+ var style$1y = cB("base-clear", `
35567
35567
  flex-shrink: 0;
35568
35568
  height: 1em;
35569
35569
  width: 1em;
@@ -35604,7 +35604,7 @@
35604
35604
  onClear: Function
35605
35605
  },
35606
35606
  setup(props) {
35607
- useStyle("-base-clear", style$1x, vue.toRef(props, "clsPrefix"));
35607
+ useStyle("-base-clear", style$1y, vue.toRef(props, "clsPrefix"));
35608
35608
  return {
35609
35609
  handleMouseDown(e) {
35610
35610
  e.preventDefault();
@@ -35698,7 +35698,7 @@
35698
35698
  }
35699
35699
  });
35700
35700
 
35701
- const self$1j = vars => {
35701
+ const self$1k = vars => {
35702
35702
  const {
35703
35703
  borderRadius,
35704
35704
  iconMedium,
@@ -35856,7 +35856,7 @@
35856
35856
  peers: {
35857
35857
  Popover: popoverLight
35858
35858
  },
35859
- self: self$1j
35859
+ self: self$1k
35860
35860
  });
35861
35861
 
35862
35862
  const internalSelectionDark = {
@@ -35865,7 +35865,7 @@
35865
35865
  peers: {
35866
35866
  Popover: popoverDark
35867
35867
  },
35868
- self: self$1j
35868
+ self: self$1k
35869
35869
  };
35870
35870
 
35871
35871
  function generateSecondaryStates(state) {
@@ -35889,7 +35889,7 @@
35889
35889
  color: var(--u-arrow-color${state}-secondary);
35890
35890
  `)])];
35891
35891
  }
35892
- var style$1w = c$1([cB("base-selection", `
35892
+ var style$1x = c$1([cB("base-selection", `
35893
35893
  position: relative;
35894
35894
  z-index: auto;
35895
35895
  box-shadow: none;
@@ -36236,7 +36236,7 @@
36236
36236
  const themeRef = useTheme(
36237
36237
  "InternalSelection",
36238
36238
  "-internal-selection",
36239
- style$1w,
36239
+ style$1x,
36240
36240
  internalSelectionLight,
36241
36241
  props,
36242
36242
  vue.toRef(props, "clsPrefix")
@@ -37299,7 +37299,7 @@
37299
37299
  })];
37300
37300
  }
37301
37301
 
37302
- var style$1v = c$1([c$1("@keyframes u-base-slot-machine-fade-up-in", `
37302
+ var style$1w = c$1([c$1("@keyframes u-base-slot-machine-fade-up-in", `
37303
37303
  from {
37304
37304
  transform: translateY(60%);
37305
37305
  opacity: 0;
@@ -37418,7 +37418,7 @@
37418
37418
  }
37419
37419
  },
37420
37420
  setup(props) {
37421
- useStyle("-base-slot-machine", style$1v, vue.toRef(props, "clsPrefix"));
37421
+ useStyle("-base-slot-machine", style$1w, vue.toRef(props, "clsPrefix"));
37422
37422
  const oldValueRef = vue.ref();
37423
37423
  const newValueRef = vue.ref();
37424
37424
  const numbersRef = vue.computed(() => {
@@ -37471,6 +37471,908 @@
37471
37471
  }
37472
37472
  });
37473
37473
 
37474
+ const commonVars$9 = {
37475
+ railInsetHorizontalBottom: "auto 2px 4px 2px",
37476
+ railInsetHorizontalTop: "4px 2px auto 2px",
37477
+ railInsetVerticalRight: "2px 4px 2px auto",
37478
+ railInsetVerticalLeft: "2px auto 2px 4px",
37479
+ railColor: "transparent"
37480
+ };
37481
+
37482
+ const self$1j = vars => {
37483
+ const {
37484
+ scrollbarColor,
37485
+ scrollbarColorHover,
37486
+ scrollbarHeight,
37487
+ scrollbarWidth,
37488
+ scrollbarBorderRadius
37489
+ } = vars;
37490
+ return {
37491
+ ...commonVars$9,
37492
+ height: scrollbarHeight,
37493
+ width: scrollbarWidth,
37494
+ borderRadius: scrollbarBorderRadius,
37495
+ color: scrollbarColor,
37496
+ colorHover: scrollbarColorHover
37497
+ };
37498
+ };
37499
+ const safeTopScrollbarLight = {
37500
+ name: "SafeTopScrollbar",
37501
+ common: derived,
37502
+ self: self$1j
37503
+ };
37504
+
37505
+ const safeTopScrollbarDark = {
37506
+ name: "SafeTopScrollbar",
37507
+ common: derived$1,
37508
+ self: self$1j
37509
+ };
37510
+
37511
+ cB("scrollbar", [cM("rtl", `
37512
+ direction: rtl;
37513
+ `, [c$1(">", [cB("scrollbar-rail", [cM("horizontal", [c$1(">", [cE("scrollbar", `
37514
+ left: 0;
37515
+ right: unset;
37516
+ `)])]), cM("vertical", `
37517
+ left: 4px;
37518
+ right: unset;
37519
+ `)])])])]);
37520
+
37521
+ var style$1v = cB("safe-top-scrollbar", `
37522
+ overflow: hidden;
37523
+ position: relative;
37524
+ z-index: auto;
37525
+ height: 100%;
37526
+ width: 100%;
37527
+ `, [c$1(">", [cB("scrollbar-container", `
37528
+ width: 100%;
37529
+ overflow: scroll;
37530
+ height: 100%;
37531
+ min-height: inherit;
37532
+ max-height: inherit;
37533
+ scrollbar-width: none;
37534
+ `, [c$1("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb", `
37535
+ width: 0;
37536
+ height: 0;
37537
+ display: none;
37538
+ `), c$1(">", [
37539
+ // We can't set overflow hidden since it affects positioning.
37540
+ cB("scrollbar-content", `
37541
+ box-sizing: border-box;
37542
+ min-width: 100%;
37543
+ `)])])]), c$1(">, +", [cB("scrollbar-rail", `
37544
+ position: absolute;
37545
+ pointer-events: none;
37546
+ user-select: none;
37547
+ background: var(--u-scrollbar-rail-color);
37548
+ -webkit-user-select: none;
37549
+ `, [cM("horizontal", `
37550
+ height: var(--u-scrollbar-height);
37551
+ `, [c$1(">", [cE("scrollbar", `
37552
+ height: var(--u-scrollbar-height);
37553
+ border-radius: var(--u-scrollbar-border-radius);
37554
+ right: 0;
37555
+ `)])]), cM("horizontal--top", `
37556
+ top: var(--u-scrollbar-rail-top-horizontal-top);
37557
+ right: var(--u-scrollbar-rail-right-horizontal-top);
37558
+ bottom: var(--u-scrollbar-rail-bottom-horizontal-top);
37559
+ left: var(--u-scrollbar-rail-left-horizontal-top);
37560
+ `), cM("horizontal--bottom", `
37561
+ top: var(--u-scrollbar-rail-top-horizontal-bottom);
37562
+ right: var(--u-scrollbar-rail-right-horizontal-bottom);
37563
+ bottom: var(--u-scrollbar-rail-bottom-horizontal-bottom);
37564
+ left: var(--u-scrollbar-rail-left-horizontal-bottom);
37565
+ `), cM("vertical", `
37566
+ width: var(--u-scrollbar-width);
37567
+ `, [c$1(">", [cE("scrollbar", `
37568
+ width: var(--u-scrollbar-width);
37569
+ border-radius: var(--u-scrollbar-border-radius);
37570
+ bottom: 0;
37571
+ `)])]), cM("vertical--left", `
37572
+ top: var(--u-scrollbar-rail-top-vertical-left);
37573
+ right: var(--u-scrollbar-rail-right-vertical-left);
37574
+ bottom: var(--u-scrollbar-rail-bottom-vertical-left);
37575
+ left: var(--u-scrollbar-rail-left-vertical-left);
37576
+ `), cM("vertical--right", `
37577
+ top: var(--u-scrollbar-rail-top-vertical-right);
37578
+ right: var(--u-scrollbar-rail-right-vertical-right);
37579
+ bottom: var(--u-scrollbar-rail-bottom-vertical-right);
37580
+ left: var(--u-scrollbar-rail-left-vertical-right);
37581
+ `), cM("disabled", [c$1(">", [cE("scrollbar", "pointer-events: none;")])]), c$1(">", [cE("scrollbar", `
37582
+ z-index: 1;
37583
+ position: absolute;
37584
+ cursor: pointer;
37585
+ pointer-events: all;
37586
+ background-color: var(--u-scrollbar-color);
37587
+ transition: background-color .2s var(--u-scrollbar-bezier);
37588
+ `, [fadeInTransition(), c$1("&:hover", "background-color: var(--u-scrollbar-color-hover);")])])])])]);
37589
+
37590
+ const safeTopscrollbarProps = {
37591
+ ...useTheme.props,
37592
+ duration: {
37593
+ type: Number,
37594
+ default: 0
37595
+ },
37596
+ scrollable: {
37597
+ type: Boolean,
37598
+ default: true
37599
+ },
37600
+ xScrollable: Boolean,
37601
+ trigger: {
37602
+ type: String,
37603
+ default: "hover"
37604
+ },
37605
+ useUnifiedContainer: Boolean,
37606
+ triggerDisplayManually: Boolean,
37607
+ // If container is set, resize observer won't not attached
37608
+ container: Function,
37609
+ content: Function,
37610
+ containerClass: String,
37611
+ containerStyle: [String, Object],
37612
+ contentClass: [String, Array],
37613
+ contentStyle: [String, Object],
37614
+ horizontalRailStyle: [String, Object],
37615
+ verticalRailStyle: [String, Object],
37616
+ onScroll: Function,
37617
+ onWheel: Function,
37618
+ onResize: Function,
37619
+ internalOnUpdateScrollLeft: Function,
37620
+ internalHoistYRail: Boolean,
37621
+ yPlacement: {
37622
+ type: String,
37623
+ default: "right"
37624
+ },
37625
+ xPlacement: {
37626
+ type: String,
37627
+ default: "bottom"
37628
+ }
37629
+ };
37630
+ const SafeTopScrollbar$1 = vue.defineComponent({
37631
+ name: "SafeTopScrollbar",
37632
+ props: safeTopscrollbarProps,
37633
+ inheritAttrs: false,
37634
+ setup(props) {
37635
+ const { mergedClsPrefixRef, inlineThemeDisabled, mergedRtlRef } = useConfig(props);
37636
+ const rtlEnabledRef = useRtl(
37637
+ "SafeTopScrollbar",
37638
+ mergedRtlRef,
37639
+ mergedClsPrefixRef
37640
+ );
37641
+ const wrapperRef = vue.ref(null);
37642
+ const containerRef = vue.ref(null);
37643
+ const contentRef = vue.ref(null);
37644
+ const yRailRef = vue.ref(null);
37645
+ const xRailRef = vue.ref(null);
37646
+ const contentHeightRef = vue.ref(null);
37647
+ const contentWidthRef = vue.ref(null);
37648
+ const containerHeightRef = vue.ref(null);
37649
+ const containerWidthRef = vue.ref(null);
37650
+ const yRailSizeRef = vue.ref(null);
37651
+ const xRailSizeRef = vue.ref(null);
37652
+ const containerScrollTopRef = vue.ref(0);
37653
+ const containerScrollLeftRef = vue.ref(0);
37654
+ const isShowXBarRef = vue.ref(false);
37655
+ const isShowYBarRef = vue.ref(false);
37656
+ let yBarPressed = false;
37657
+ let xBarPressed = false;
37658
+ let xBarVanishTimerId;
37659
+ let yBarVanishTimerId;
37660
+ let memoYTop = 0;
37661
+ let memoXLeft = 0;
37662
+ let memoMouseX = 0;
37663
+ let memoMouseY = 0;
37664
+ let previousScrollHeight = 0;
37665
+ let previousScrollTop = 0;
37666
+ const isIos = useIsIos();
37667
+ const themeRef = useTheme(
37668
+ "SafeTopScrollbar",
37669
+ "-safe-top-scrollbar",
37670
+ style$1v,
37671
+ safeTopScrollbarLight,
37672
+ props,
37673
+ mergedClsPrefixRef
37674
+ );
37675
+ const yBarSizeRef = vue.computed(() => {
37676
+ const { value: containerHeight } = containerHeightRef;
37677
+ const { value: contentHeight } = contentHeightRef;
37678
+ const { value: yRailSize } = yRailSizeRef;
37679
+ if (containerHeight === null || contentHeight === null || yRailSize === null) {
37680
+ return 0;
37681
+ } else {
37682
+ return Math.min(
37683
+ containerHeight,
37684
+ yRailSize * containerHeight / contentHeight + depx(themeRef.value.self.width) * 1.5
37685
+ );
37686
+ }
37687
+ });
37688
+ const yBarSizePxRef = vue.computed(() => {
37689
+ return `${yBarSizeRef.value}px`;
37690
+ });
37691
+ const xBarSizeRef = vue.computed(() => {
37692
+ const { value: containerWidth } = containerWidthRef;
37693
+ const { value: contentWidth } = contentWidthRef;
37694
+ const { value: xRailSize } = xRailSizeRef;
37695
+ if (containerWidth === null || contentWidth === null || xRailSize === null) {
37696
+ return 0;
37697
+ } else {
37698
+ return xRailSize * containerWidth / contentWidth + depx(themeRef.value.self.height) * 1.5;
37699
+ }
37700
+ });
37701
+ const xBarSizePxRef = vue.computed(() => {
37702
+ return `${xBarSizeRef.value}px`;
37703
+ });
37704
+ const yBarTopRef = vue.computed(() => {
37705
+ const { value: containerHeight } = containerHeightRef;
37706
+ const { value: containerScrollTop } = containerScrollTopRef;
37707
+ const { value: contentHeight } = contentHeightRef;
37708
+ const { value: yRailSize } = yRailSizeRef;
37709
+ if (containerHeight === null || contentHeight === null || yRailSize === null) {
37710
+ return 0;
37711
+ } else {
37712
+ const heightDiff = contentHeight - containerHeight;
37713
+ if (!heightDiff) return 0;
37714
+ return containerScrollTop / heightDiff * (yRailSize - yBarSizeRef.value);
37715
+ }
37716
+ });
37717
+ const yBarTopPxRef = vue.computed(() => {
37718
+ return `${yBarTopRef.value}px`;
37719
+ });
37720
+ const xBarLeftRef = vue.computed(() => {
37721
+ const { value: containerWidth } = containerWidthRef;
37722
+ const { value: containerScrollLeft } = containerScrollLeftRef;
37723
+ const { value: contentWidth } = contentWidthRef;
37724
+ const { value: xRailSize } = xRailSizeRef;
37725
+ if (containerWidth === null || contentWidth === null || xRailSize === null) {
37726
+ return 0;
37727
+ } else {
37728
+ const widthDiff = contentWidth - containerWidth;
37729
+ if (!widthDiff) return 0;
37730
+ return containerScrollLeft / widthDiff * (xRailSize - xBarSizeRef.value);
37731
+ }
37732
+ });
37733
+ const xBarLeftPxRef = vue.computed(() => {
37734
+ return `${xBarLeftRef.value}px`;
37735
+ });
37736
+ const needYBarRef = vue.computed(() => {
37737
+ const { value: containerHeight } = containerHeightRef;
37738
+ const { value: contentHeight } = contentHeightRef;
37739
+ return containerHeight !== null && contentHeight !== null && contentHeight > containerHeight;
37740
+ });
37741
+ const needXBarRef = vue.computed(() => {
37742
+ const { value: containerWidth } = containerWidthRef;
37743
+ const { value: contentWidth } = contentWidthRef;
37744
+ return containerWidth !== null && contentWidth !== null && contentWidth > containerWidth;
37745
+ });
37746
+ const mergedShowXBarRef = vue.computed(() => {
37747
+ const { trigger } = props;
37748
+ return trigger === "none" || isShowXBarRef.value;
37749
+ });
37750
+ const mergedShowYBarRef = vue.computed(() => {
37751
+ const { trigger } = props;
37752
+ return trigger === "none" || isShowYBarRef.value;
37753
+ });
37754
+ const mergedContainerRef = vue.computed(() => {
37755
+ const { container } = props;
37756
+ if (container) return container();
37757
+ return containerRef.value;
37758
+ });
37759
+ const mergedContentRef = vue.computed(() => {
37760
+ const { content } = props;
37761
+ if (content) return content();
37762
+ return contentRef.value;
37763
+ });
37764
+ const scrollTo = (options, y) => {
37765
+ if (!props.scrollable) return;
37766
+ if (typeof options === "number") {
37767
+ scrollToPosition(options, y ?? 0, 0, false, "auto");
37768
+ return;
37769
+ }
37770
+ const {
37771
+ left,
37772
+ top,
37773
+ index,
37774
+ elSize,
37775
+ position,
37776
+ behavior,
37777
+ el,
37778
+ debounce = true
37779
+ } = options;
37780
+ if (left !== void 0 || top !== void 0) {
37781
+ scrollToPosition(left ?? 0, top ?? 0, 0, false, behavior);
37782
+ }
37783
+ if (el !== void 0) {
37784
+ scrollToPosition(0, el.offsetTop, el.offsetHeight, debounce, behavior);
37785
+ } else if (index !== void 0 && elSize !== void 0) {
37786
+ scrollToPosition(0, index * elSize, elSize, debounce, behavior);
37787
+ } else if (position === "bottom") {
37788
+ scrollToPosition(0, Number.MAX_SAFE_INTEGER, 0, false, behavior);
37789
+ } else if (position === "top") {
37790
+ scrollToPosition(0, 0, 0, false, behavior);
37791
+ }
37792
+ };
37793
+ const activateState = useReactivated(() => {
37794
+ if (!props.container) {
37795
+ scrollTo({
37796
+ top: containerScrollTopRef.value,
37797
+ left: containerScrollLeftRef.value
37798
+ });
37799
+ }
37800
+ });
37801
+ const handleContentResize = () => {
37802
+ if (activateState.isDeactivated) return;
37803
+ const { value: container } = mergedContainerRef;
37804
+ if (container && previousScrollHeight > 0) {
37805
+ const currentScrollHeight = container.scrollHeight;
37806
+ const currentScrollTop = container.scrollTop;
37807
+ const savedScrollHeight = previousScrollHeight;
37808
+ const savedScrollTop = previousScrollTop;
37809
+ const heightDiff = currentScrollHeight - savedScrollHeight;
37810
+ if (heightDiff > 0 && currentScrollTop === savedScrollTop) {
37811
+ container.scrollTop = savedScrollTop + heightDiff;
37812
+ }
37813
+ sync();
37814
+ } else {
37815
+ sync();
37816
+ }
37817
+ };
37818
+ const handleContainerResize = (e) => {
37819
+ if (activateState.isDeactivated) return;
37820
+ const { onResize } = props;
37821
+ if (onResize) {
37822
+ onResize(e);
37823
+ }
37824
+ sync();
37825
+ };
37826
+ const scrollBy = (options, y) => {
37827
+ if (!props.scrollable) return;
37828
+ const { value: container } = mergedContainerRef;
37829
+ if (!container) return;
37830
+ if (typeof options === "object") {
37831
+ container.scrollBy(options);
37832
+ } else {
37833
+ container.scrollBy(options, y || 0);
37834
+ }
37835
+ };
37836
+ function scrollToPosition(left, top, elSize, debounce, behavior) {
37837
+ const { value: container } = mergedContainerRef;
37838
+ if (!container) return;
37839
+ if (debounce) {
37840
+ const { scrollTop, offsetHeight } = container;
37841
+ if (top > scrollTop) {
37842
+ if (top + elSize <= scrollTop + offsetHeight) ; else {
37843
+ container.scrollTo({
37844
+ left,
37845
+ top: top + elSize - offsetHeight,
37846
+ behavior
37847
+ });
37848
+ }
37849
+ return;
37850
+ }
37851
+ }
37852
+ container.scrollTo({
37853
+ left,
37854
+ top,
37855
+ behavior
37856
+ });
37857
+ }
37858
+ function handleMouseEnterWrapper() {
37859
+ showXBar();
37860
+ showYBar();
37861
+ sync();
37862
+ }
37863
+ function handleMouseLeaveWrapper() {
37864
+ hideBar();
37865
+ }
37866
+ function hideBar() {
37867
+ hideYBar();
37868
+ hideXBar();
37869
+ }
37870
+ function hideYBar() {
37871
+ if (yBarVanishTimerId !== void 0) {
37872
+ window.clearTimeout(yBarVanishTimerId);
37873
+ }
37874
+ yBarVanishTimerId = window.setTimeout(() => {
37875
+ isShowYBarRef.value = false;
37876
+ }, props.duration);
37877
+ }
37878
+ function hideXBar() {
37879
+ if (xBarVanishTimerId !== void 0) {
37880
+ window.clearTimeout(xBarVanishTimerId);
37881
+ }
37882
+ xBarVanishTimerId = window.setTimeout(() => {
37883
+ isShowXBarRef.value = false;
37884
+ }, props.duration);
37885
+ }
37886
+ function showXBar() {
37887
+ if (xBarVanishTimerId !== void 0) {
37888
+ window.clearTimeout(xBarVanishTimerId);
37889
+ }
37890
+ isShowXBarRef.value = true;
37891
+ }
37892
+ function showYBar() {
37893
+ if (yBarVanishTimerId !== void 0) {
37894
+ window.clearTimeout(yBarVanishTimerId);
37895
+ }
37896
+ isShowYBarRef.value = true;
37897
+ }
37898
+ function handleScroll(e) {
37899
+ const { onScroll } = props;
37900
+ if (onScroll) onScroll(e);
37901
+ const { value: container } = mergedContainerRef;
37902
+ if (container) {
37903
+ previousScrollHeight = container.scrollHeight;
37904
+ previousScrollTop = container.scrollTop;
37905
+ }
37906
+ syncScrollState();
37907
+ }
37908
+ function syncScrollState() {
37909
+ const { value: container } = mergedContainerRef;
37910
+ if (container) {
37911
+ containerScrollTopRef.value = container.scrollTop;
37912
+ containerScrollLeftRef.value = container.scrollLeft * (rtlEnabledRef?.value ? -1 : 1);
37913
+ }
37914
+ }
37915
+ function syncPositionState() {
37916
+ const { value: content } = mergedContentRef;
37917
+ if (content) {
37918
+ contentHeightRef.value = content.offsetHeight;
37919
+ contentWidthRef.value = content.offsetWidth;
37920
+ }
37921
+ const { value: container } = mergedContainerRef;
37922
+ if (container) {
37923
+ containerHeightRef.value = container.offsetHeight;
37924
+ containerWidthRef.value = container.offsetWidth;
37925
+ }
37926
+ const { value: xRailEl } = xRailRef;
37927
+ const { value: yRailEl } = yRailRef;
37928
+ if (xRailEl) {
37929
+ xRailSizeRef.value = xRailEl.offsetWidth;
37930
+ }
37931
+ if (yRailEl) {
37932
+ yRailSizeRef.value = yRailEl.offsetHeight;
37933
+ }
37934
+ }
37935
+ function syncUnifiedContainer() {
37936
+ const { value: container } = mergedContainerRef;
37937
+ if (container) {
37938
+ containerScrollTopRef.value = container.scrollTop;
37939
+ containerScrollLeftRef.value = container.scrollLeft * (rtlEnabledRef?.value ? -1 : 1);
37940
+ containerHeightRef.value = container.offsetHeight;
37941
+ containerWidthRef.value = container.offsetWidth;
37942
+ contentHeightRef.value = container.scrollHeight;
37943
+ contentWidthRef.value = container.scrollWidth;
37944
+ }
37945
+ const { value: xRailEl } = xRailRef;
37946
+ const { value: yRailEl } = yRailRef;
37947
+ if (xRailEl) {
37948
+ xRailSizeRef.value = xRailEl.offsetWidth;
37949
+ }
37950
+ if (yRailEl) {
37951
+ yRailSizeRef.value = yRailEl.offsetHeight;
37952
+ }
37953
+ }
37954
+ function sync() {
37955
+ if (!props.scrollable) return;
37956
+ if (props.useUnifiedContainer) {
37957
+ syncUnifiedContainer();
37958
+ } else {
37959
+ syncPositionState();
37960
+ syncScrollState();
37961
+ }
37962
+ const { value: container } = mergedContainerRef;
37963
+ if (container) {
37964
+ previousScrollHeight = container.scrollHeight;
37965
+ previousScrollTop = container.scrollTop;
37966
+ }
37967
+ }
37968
+ function isMouseUpAway(e) {
37969
+ return !wrapperRef.value?.contains(
37970
+ getPreciseEventTarget(e)
37971
+ );
37972
+ }
37973
+ function handleXScrollMouseDown(e) {
37974
+ e.preventDefault();
37975
+ e.stopPropagation();
37976
+ xBarPressed = true;
37977
+ on("mousemove", window, handleXScrollMouseMove, true);
37978
+ on("mouseup", window, handleXScrollMouseUp, true);
37979
+ memoXLeft = containerScrollLeftRef.value;
37980
+ memoMouseX = rtlEnabledRef?.value ? window.innerWidth - e.clientX : e.clientX;
37981
+ }
37982
+ function handleXScrollMouseMove(e) {
37983
+ if (!xBarPressed) return;
37984
+ if (xBarVanishTimerId !== void 0) {
37985
+ window.clearTimeout(xBarVanishTimerId);
37986
+ }
37987
+ if (yBarVanishTimerId !== void 0) {
37988
+ window.clearTimeout(yBarVanishTimerId);
37989
+ }
37990
+ const { value: containerWidth } = containerWidthRef;
37991
+ const { value: contentWidth } = contentWidthRef;
37992
+ const { value: xBarSize } = xBarSizeRef;
37993
+ if (containerWidth === null || contentWidth === null) return;
37994
+ const dX = rtlEnabledRef?.value ? window.innerWidth - e.clientX - memoMouseX : e.clientX - memoMouseX;
37995
+ const dScrollLeft = dX * (contentWidth - containerWidth) / (containerWidth - xBarSize);
37996
+ const toScrollLeftUpperBound = contentWidth - containerWidth;
37997
+ let toScrollLeft = memoXLeft + dScrollLeft;
37998
+ toScrollLeft = Math.min(toScrollLeftUpperBound, toScrollLeft);
37999
+ toScrollLeft = Math.max(toScrollLeft, 0);
38000
+ const { value: container } = mergedContainerRef;
38001
+ if (container) {
38002
+ container.scrollLeft = toScrollLeft * (rtlEnabledRef?.value ? -1 : 1);
38003
+ const { internalOnUpdateScrollLeft } = props;
38004
+ if (internalOnUpdateScrollLeft) internalOnUpdateScrollLeft(toScrollLeft);
38005
+ }
38006
+ }
38007
+ function handleXScrollMouseUp(e) {
38008
+ e.preventDefault();
38009
+ e.stopPropagation();
38010
+ off("mousemove", window, handleXScrollMouseMove, true);
38011
+ off("mouseup", window, handleXScrollMouseUp, true);
38012
+ xBarPressed = false;
38013
+ sync();
38014
+ if (isMouseUpAway(e)) {
38015
+ hideBar();
38016
+ }
38017
+ }
38018
+ function handleYScrollMouseDown(e) {
38019
+ e.preventDefault();
38020
+ e.stopPropagation();
38021
+ yBarPressed = true;
38022
+ on("mousemove", window, handleYScrollMouseMove, true);
38023
+ on("mouseup", window, handleYScrollMouseUp, true);
38024
+ memoYTop = containerScrollTopRef.value;
38025
+ memoMouseY = e.clientY;
38026
+ }
38027
+ function handleYScrollMouseMove(e) {
38028
+ if (!yBarPressed) return;
38029
+ if (xBarVanishTimerId !== void 0) {
38030
+ window.clearTimeout(xBarVanishTimerId);
38031
+ }
38032
+ if (yBarVanishTimerId !== void 0) {
38033
+ window.clearTimeout(yBarVanishTimerId);
38034
+ }
38035
+ const { value: containerHeight } = containerHeightRef;
38036
+ const { value: contentHeight } = contentHeightRef;
38037
+ const { value: yBarSize } = yBarSizeRef;
38038
+ if (containerHeight === null || contentHeight === null) return;
38039
+ const dY = e.clientY - memoMouseY;
38040
+ const dScrollTop = dY * (contentHeight - containerHeight) / (containerHeight - yBarSize);
38041
+ const toScrollTopUpperBound = contentHeight - containerHeight;
38042
+ let toScrollTop = memoYTop + dScrollTop;
38043
+ toScrollTop = Math.min(toScrollTopUpperBound, toScrollTop);
38044
+ toScrollTop = Math.max(toScrollTop, 0);
38045
+ const { value: container } = mergedContainerRef;
38046
+ if (container) {
38047
+ container.scrollTop = toScrollTop;
38048
+ }
38049
+ }
38050
+ function handleYScrollMouseUp(e) {
38051
+ e.preventDefault();
38052
+ e.stopPropagation();
38053
+ off("mousemove", window, handleYScrollMouseMove, true);
38054
+ off("mouseup", window, handleYScrollMouseUp, true);
38055
+ yBarPressed = false;
38056
+ sync();
38057
+ if (isMouseUpAway(e)) {
38058
+ hideBar();
38059
+ }
38060
+ }
38061
+ vue.watchEffect(() => {
38062
+ const { value: needXBar } = needXBarRef;
38063
+ const { value: needYBar } = needYBarRef;
38064
+ const { value: mergedClsPrefix } = mergedClsPrefixRef;
38065
+ const { value: xRailEl } = xRailRef;
38066
+ const { value: yRailEl } = yRailRef;
38067
+ if (xRailEl) {
38068
+ if (!needXBar) {
38069
+ xRailEl.classList.add(`${mergedClsPrefix}-scrollbar-rail--disabled`);
38070
+ } else {
38071
+ xRailEl.classList.remove(
38072
+ `${mergedClsPrefix}-scrollbar-rail--disabled`
38073
+ );
38074
+ }
38075
+ }
38076
+ if (yRailEl) {
38077
+ if (!needYBar) {
38078
+ yRailEl.classList.add(`${mergedClsPrefix}-scrollbar-rail--disabled`);
38079
+ } else {
38080
+ yRailEl.classList.remove(
38081
+ `${mergedClsPrefix}-scrollbar-rail--disabled`
38082
+ );
38083
+ }
38084
+ }
38085
+ });
38086
+ vue.onMounted(() => {
38087
+ if (props.container) return;
38088
+ sync();
38089
+ const { value: container } = mergedContainerRef;
38090
+ if (container) {
38091
+ previousScrollHeight = container.scrollHeight;
38092
+ previousScrollTop = container.scrollTop;
38093
+ }
38094
+ });
38095
+ vue.onBeforeUnmount(() => {
38096
+ if (xBarVanishTimerId !== void 0) {
38097
+ window.clearTimeout(xBarVanishTimerId);
38098
+ }
38099
+ if (yBarVanishTimerId !== void 0) {
38100
+ window.clearTimeout(yBarVanishTimerId);
38101
+ }
38102
+ off("mousemove", window, handleYScrollMouseMove, true);
38103
+ off("mouseup", window, handleYScrollMouseUp, true);
38104
+ });
38105
+ const cssVarsRef = vue.computed(() => {
38106
+ const {
38107
+ common: { cubicBezierEaseInOut },
38108
+ self: {
38109
+ color,
38110
+ colorHover,
38111
+ height,
38112
+ width,
38113
+ borderRadius,
38114
+ railInsetHorizontalTop,
38115
+ railInsetHorizontalBottom,
38116
+ railInsetVerticalRight,
38117
+ railInsetVerticalLeft,
38118
+ railColor
38119
+ }
38120
+ } = themeRef.value;
38121
+ const {
38122
+ top: railTopHorizontalTop,
38123
+ right: railRightHorizontalTop,
38124
+ bottom: railBottomHorizontalTop,
38125
+ left: railLeftHorizontalTop
38126
+ } = getMargin(railInsetHorizontalTop);
38127
+ const {
38128
+ top: railTopHorizontalBottom,
38129
+ right: railRightHorizontalBottom,
38130
+ bottom: railBottomHorizontalBottom,
38131
+ left: railLeftHorizontalBottom
38132
+ } = getMargin(railInsetHorizontalBottom);
38133
+ const {
38134
+ top: railTopVerticalRight,
38135
+ right: railRightVerticalRight,
38136
+ bottom: railBottomVerticalRight,
38137
+ left: railLeftVerticalRight
38138
+ } = getMargin(
38139
+ rtlEnabledRef?.value ? rtlInset(railInsetVerticalRight) : railInsetVerticalRight
38140
+ );
38141
+ const {
38142
+ top: railTopVerticalLeft,
38143
+ right: railRightVerticalLeft,
38144
+ bottom: railBottomVerticalLeft,
38145
+ left: railLeftVerticalLeft
38146
+ } = getMargin(
38147
+ rtlEnabledRef?.value ? rtlInset(railInsetVerticalLeft) : railInsetVerticalLeft
38148
+ );
38149
+ return {
38150
+ "--u-scrollbar-bezier": cubicBezierEaseInOut,
38151
+ "--u-scrollbar-color": color,
38152
+ "--u-scrollbar-color-hover": colorHover,
38153
+ "--u-scrollbar-border-radius": borderRadius,
38154
+ "--u-scrollbar-width": width,
38155
+ "--u-scrollbar-height": height,
38156
+ "--u-scrollbar-rail-top-horizontal-top": railTopHorizontalTop,
38157
+ "--u-scrollbar-rail-right-horizontal-top": railRightHorizontalTop,
38158
+ "--u-scrollbar-rail-bottom-horizontal-top": railBottomHorizontalTop,
38159
+ "--u-scrollbar-rail-left-horizontal-top": railLeftHorizontalTop,
38160
+ "--u-scrollbar-rail-top-horizontal-bottom": railTopHorizontalBottom,
38161
+ "--u-scrollbar-rail-right-horizontal-bottom": railRightHorizontalBottom,
38162
+ "--u-scrollbar-rail-bottom-horizontal-bottom": railBottomHorizontalBottom,
38163
+ "--u-scrollbar-rail-left-horizontal-bottom": railLeftHorizontalBottom,
38164
+ "--u-scrollbar-rail-top-vertical-right": railTopVerticalRight,
38165
+ "--u-scrollbar-rail-right-vertical-right": railRightVerticalRight,
38166
+ "--u-scrollbar-rail-bottom-vertical-right": railBottomVerticalRight,
38167
+ "--u-scrollbar-rail-left-vertical-right": railLeftVerticalRight,
38168
+ "--u-scrollbar-rail-top-vertical-left": railTopVerticalLeft,
38169
+ "--u-scrollbar-rail-right-vertical-left": railRightVerticalLeft,
38170
+ "--u-scrollbar-rail-bottom-vertical-left": railBottomVerticalLeft,
38171
+ "--u-scrollbar-rail-left-vertical-left": railLeftVerticalLeft,
38172
+ "--u-scrollbar-rail-color": railColor
38173
+ };
38174
+ });
38175
+ const themeClassHandle = inlineThemeDisabled ? useThemeClass("scrollbar", void 0, cssVarsRef, props) : void 0;
38176
+ function getScrollState() {
38177
+ const { value: container } = mergedContainerRef;
38178
+ if (!container) {
38179
+ return { scrollHeight: 0, scrollTop: 0, clientHeight: 0 };
38180
+ }
38181
+ return {
38182
+ scrollHeight: container.scrollHeight,
38183
+ scrollTop: container.scrollTop,
38184
+ clientHeight: container.clientHeight
38185
+ };
38186
+ }
38187
+ function adjustScrollTop(heightDiff) {
38188
+ const { value: container } = mergedContainerRef;
38189
+ if (!container) return;
38190
+ container.scrollTop = container.scrollTop + heightDiff;
38191
+ }
38192
+ const exposedMethods = {
38193
+ scrollTo,
38194
+ scrollBy,
38195
+ sync,
38196
+ syncUnifiedContainer,
38197
+ handleMouseEnterWrapper,
38198
+ handleMouseLeaveWrapper,
38199
+ getScrollState,
38200
+ adjustScrollTop
38201
+ };
38202
+ return {
38203
+ ...exposedMethods,
38204
+ mergedClsPrefix: mergedClsPrefixRef,
38205
+ rtlEnabled: rtlEnabledRef,
38206
+ containerScrollTop: containerScrollTopRef,
38207
+ wrapperRef,
38208
+ containerRef,
38209
+ contentRef,
38210
+ yRailRef,
38211
+ xRailRef,
38212
+ needYBar: needYBarRef,
38213
+ needXBar: needXBarRef,
38214
+ yBarSizePx: yBarSizePxRef,
38215
+ xBarSizePx: xBarSizePxRef,
38216
+ yBarTopPx: yBarTopPxRef,
38217
+ xBarLeftPx: xBarLeftPxRef,
38218
+ isShowXBar: mergedShowXBarRef,
38219
+ isShowYBar: mergedShowYBarRef,
38220
+ isIos,
38221
+ handleScroll,
38222
+ handleContentResize,
38223
+ handleContainerResize,
38224
+ handleYScrollMouseDown,
38225
+ handleXScrollMouseDown,
38226
+ cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
38227
+ themeClass: themeClassHandle?.themeClass,
38228
+ onRender: themeClassHandle?.onRender
38229
+ };
38230
+ },
38231
+ render() {
38232
+ const {
38233
+ $slots,
38234
+ mergedClsPrefix,
38235
+ triggerDisplayManually,
38236
+ rtlEnabled,
38237
+ internalHoistYRail,
38238
+ yPlacement,
38239
+ xPlacement,
38240
+ xScrollable
38241
+ } = this;
38242
+ if (!this.scrollable) return $slots.default?.();
38243
+ const triggerIsNone = this.trigger === "none";
38244
+ const createYRail = (className, style2) => {
38245
+ return /* @__PURE__ */ vue.h(
38246
+ "div",
38247
+ {
38248
+ ref: "yRailRef",
38249
+ class: [
38250
+ `${mergedClsPrefix}-scrollbar-rail`,
38251
+ `${mergedClsPrefix}-scrollbar-rail--vertical`,
38252
+ `${mergedClsPrefix}-scrollbar-rail--vertical--${yPlacement}`,
38253
+ className
38254
+ ],
38255
+ "data-scrollbar-rail": true,
38256
+ style: [style2 || "", this.verticalRailStyle],
38257
+ "aria-hidden": true
38258
+ },
38259
+ vue.h(
38260
+ triggerIsNone ? Wrapper : vue.Transition,
38261
+ triggerIsNone ? null : { name: "fade-in-transition" },
38262
+ {
38263
+ default: () => this.needYBar && this.isShowYBar && !this.isIos ? /* @__PURE__ */ vue.h(
38264
+ "div",
38265
+ {
38266
+ class: `${mergedClsPrefix}-scrollbar-rail__scrollbar`,
38267
+ style: {
38268
+ height: this.yBarSizePx,
38269
+ top: this.yBarTopPx
38270
+ },
38271
+ onMousedown: this.handleYScrollMouseDown
38272
+ }
38273
+ ) : null
38274
+ }
38275
+ )
38276
+ );
38277
+ };
38278
+ const createChildren = () => {
38279
+ this.onRender?.();
38280
+ return vue.h(
38281
+ "div",
38282
+ vue.mergeProps(this.$attrs, {
38283
+ role: "none",
38284
+ ref: "wrapperRef",
38285
+ class: [
38286
+ `${mergedClsPrefix}-safe-top-scrollbar`,
38287
+ this.themeClass,
38288
+ rtlEnabled && `${mergedClsPrefix}-scrollbar--rtl`
38289
+ ],
38290
+ style: this.cssVars,
38291
+ onMouseenter: triggerDisplayManually ? void 0 : this.handleMouseEnterWrapper,
38292
+ onMouseleave: triggerDisplayManually ? void 0 : this.handleMouseLeaveWrapper
38293
+ }),
38294
+ [
38295
+ this.container ? $slots.default?.() : /* @__PURE__ */ vue.h(
38296
+ "div",
38297
+ {
38298
+ role: "none",
38299
+ ref: "containerRef",
38300
+ class: [
38301
+ `${mergedClsPrefix}-scrollbar-container`,
38302
+ this.containerClass
38303
+ ],
38304
+ style: this.containerStyle,
38305
+ onScroll: this.handleScroll,
38306
+ onWheel: this.onWheel
38307
+ },
38308
+ /* @__PURE__ */ vue.h(VResizeObserver, { onResize: this.handleContentResize }, {
38309
+ default: () => /* @__PURE__ */ vue.h(
38310
+ "div",
38311
+ {
38312
+ ref: "contentRef",
38313
+ role: "none",
38314
+ style: [
38315
+ {
38316
+ width: this.xScrollable ? "fit-content" : null
38317
+ },
38318
+ this.contentStyle
38319
+ ],
38320
+ class: [
38321
+ `${mergedClsPrefix}-scrollbar-content`,
38322
+ this.contentClass
38323
+ ]
38324
+ },
38325
+ $slots
38326
+ )
38327
+ })
38328
+ ),
38329
+ internalHoistYRail ? null : createYRail(void 0, void 0),
38330
+ xScrollable && /* @__PURE__ */ vue.h(
38331
+ "div",
38332
+ {
38333
+ ref: "xRailRef",
38334
+ class: [
38335
+ `${mergedClsPrefix}-scrollbar-rail`,
38336
+ `${mergedClsPrefix}-scrollbar-rail--horizontal`,
38337
+ `${mergedClsPrefix}-scrollbar-rail--horizontal--${xPlacement}`
38338
+ ],
38339
+ style: this.horizontalRailStyle,
38340
+ "data-scrollbar-rail": true,
38341
+ "aria-hidden": true
38342
+ },
38343
+ vue.h(
38344
+ triggerIsNone ? Wrapper : vue.Transition,
38345
+ triggerIsNone ? null : { name: "fade-in-transition" },
38346
+ {
38347
+ default: () => this.needXBar && this.isShowXBar && !this.isIos ? /* @__PURE__ */ vue.h(
38348
+ "div",
38349
+ {
38350
+ class: `${mergedClsPrefix}-scrollbar-rail__scrollbar`,
38351
+ style: {
38352
+ width: this.xBarSizePx,
38353
+ right: rtlEnabled ? this.xBarLeftPx : void 0,
38354
+ left: rtlEnabled ? void 0 : this.xBarLeftPx
38355
+ },
38356
+ onMousedown: this.handleXScrollMouseDown
38357
+ }
38358
+ ) : null
38359
+ }
38360
+ )
38361
+ )
38362
+ ]
38363
+ );
38364
+ };
38365
+ const scrollbarNode = this.container ? createChildren() : /* @__PURE__ */ vue.h(VResizeObserver, { onResize: this.handleContainerResize }, {
38366
+ default: createChildren
38367
+ });
38368
+ if (internalHoistYRail) {
38369
+ return /* @__PURE__ */ vue.h(vue.Fragment, null, scrollbarNode, createYRail(this.themeClass, this.cssVars));
38370
+ } else {
38371
+ return scrollbarNode;
38372
+ }
38373
+ }
38374
+ });
38375
+
37474
38376
  const checkboxGroupInjectionKey = createInjectionKey("u-checkbox-group");
37475
38377
  const checkboxBaseProps = {
37476
38378
  size: String,
@@ -61255,6 +62157,46 @@
61255
62157
  }
61256
62158
  });
61257
62159
 
62160
+ const safeTopScrollbarProps = {
62161
+ ...useTheme.props,
62162
+ trigger: String,
62163
+ xScrollable: Boolean,
62164
+ onScroll: Function,
62165
+ size: Number
62166
+ };
62167
+ const SafeTopScrollbar = vue.defineComponent({
62168
+ name: "SafeTopScrollbar",
62169
+ props: safeTopScrollbarProps,
62170
+ setup() {
62171
+ const scrollbarInstRef = vue.ref(null);
62172
+ const exposedMethods = {
62173
+ scrollTo: (...args) => {
62174
+ scrollbarInstRef.value?.scrollTo(args[0], args[1]);
62175
+ },
62176
+ scrollBy: (...args) => {
62177
+ scrollbarInstRef.value?.scrollBy(args[0], args[1]);
62178
+ },
62179
+ getScrollState: () => {
62180
+ return scrollbarInstRef.value?.getScrollState() || {
62181
+ scrollHeight: 0,
62182
+ scrollTop: 0,
62183
+ clientHeight: 0
62184
+ };
62185
+ },
62186
+ adjustScrollTop: (heightDiff) => {
62187
+ scrollbarInstRef.value?.adjustScrollTop(heightDiff);
62188
+ }
62189
+ };
62190
+ return {
62191
+ ...exposedMethods,
62192
+ scrollbarInstRef
62193
+ };
62194
+ },
62195
+ render() {
62196
+ return /* @__PURE__ */ vue.h(SafeTopScrollbar$1, { ref: "scrollbarInstRef", ...this.$props }, this.$slots);
62197
+ }
62198
+ });
62199
+
61258
62200
  const uploadInjectionKey = createInjectionKey("u-upload");
61259
62201
 
61260
62202
  const isImageFileType = type => type.includes("image/");
@@ -65010,12 +65952,31 @@
65010
65952
  }
65011
65953
  },
65012
65954
  setup(props, { slots }) {
65955
+ const UChat = vue.inject(chatInjectionKey, null);
65956
+ const onAttachmentDownload = UChat?.onAttachmentDownload;
65013
65957
  const getThumbnailUrl = (attachment) => {
65014
65958
  const url = [attachment.preview, attachment.thumbnail].find(
65015
65959
  (value) => typeof value === "string"
65016
65960
  );
65017
65961
  return url ?? null;
65018
65962
  };
65963
+ const handleDownload = async (file) => {
65964
+ if (onAttachmentDownload?.value) {
65965
+ const attachment = props.attachments.find(
65966
+ (att) => att.name === file.name
65967
+ );
65968
+ if (attachment) {
65969
+ try {
65970
+ await onAttachmentDownload.value(attachment);
65971
+ return false;
65972
+ } catch (error) {
65973
+ console.error("Download failed:", error);
65974
+ return false;
65975
+ }
65976
+ }
65977
+ }
65978
+ return true;
65979
+ };
65019
65980
  const renderAttachment = () => {
65020
65981
  const fileList = props.attachments.map(
65021
65982
  (attachment, index) => ({
@@ -65034,6 +65995,7 @@
65034
65995
  UUpload,
65035
65996
  {
65036
65997
  abstract: true,
65998
+ ...props.uploadProps,
65037
65999
  fileList,
65038
66000
  fileListStyle: props.withPadding ? {
65039
66001
  display: "flex",
@@ -65048,7 +66010,7 @@
65048
66010
  showRetryButton: props.attachments.some(
65049
66011
  (attachment) => attachment.status === "error"
65050
66012
  ),
65051
- ...props.uploadProps
66013
+ onDownload: handleDownload
65052
66014
  },
65053
66015
  {
65054
66016
  default: () => /* @__PURE__ */ vue.h(UUploadFileList, null, {
@@ -65627,6 +66589,7 @@
65627
66589
  handleMessageSend,
65628
66590
  handleMessageRetry,
65629
66591
  handleFooterInputChange,
66592
+ onAttachmentUpload,
65630
66593
  onChatClose,
65631
66594
  onChatShare,
65632
66595
  onUserProfile,
@@ -65638,6 +66601,7 @@
65638
66601
  const inputRef = vue.ref();
65639
66602
  const inputValue = vue.ref("");
65640
66603
  const attachmentFileList = vue.ref([]);
66604
+ const uploadedAttachmentsMap = vue.ref(/* @__PURE__ */ new Map());
65641
66605
  const lastScrollTop = vue.ref(0);
65642
66606
  const scrollTopFired = vue.ref(false);
65643
66607
  const scrollBottomFired = vue.ref(false);
@@ -65665,6 +66629,8 @@
65665
66629
  scrollTopFired.value = false;
65666
66630
  scrollBottomFired.value = false;
65667
66631
  shouldScrollOnLoad.value = true;
66632
+ attachmentFileList.value = [];
66633
+ uploadedAttachmentsMap.value.clear();
65668
66634
  if (unreadBeforeRead > 0 && !notificationsShownSetRef.value.has(newChat.id)) {
65669
66635
  hasUnreadMessages.value = true;
65670
66636
  showNotificationManually.value = true;
@@ -65936,20 +66902,29 @@
65936
66902
  if ((hasContent || hasAttachments) && selectedChatRef.value && handleMessageSend) {
65937
66903
  isSending.value = true;
65938
66904
  try {
65939
- const attachments = attachmentFileList.value.length > 0 ? attachmentFileList.value.map((file) => ({
65940
- id: file.id,
65941
- type: ChatMessageType.FILE,
65942
- name: file.name,
65943
- url: file.url || (file.file ? URL.createObjectURL(file.file) : "#"),
65944
- size: file.file?.size,
65945
- thumbnail: file.thumbnailUrl ?? void 0,
65946
- status: file.status,
65947
- percentage: file.percentage ?? void 0
65948
- })) : void 0;
66905
+ const attachments = attachmentFileList.value.length > 0 ? attachmentFileList.value.map((file) => {
66906
+ const uploadedAttachment = uploadedAttachmentsMap.value.get(
66907
+ file.id
66908
+ );
66909
+ if (uploadedAttachment) {
66910
+ return uploadedAttachment;
66911
+ }
66912
+ return {
66913
+ id: file.id,
66914
+ type: ChatMessageType.FILE,
66915
+ name: file.name,
66916
+ url: file.url || (file.file ? URL.createObjectURL(file.file) : "#"),
66917
+ size: file.file?.size,
66918
+ thumbnail: file.thumbnailUrl ?? void 0,
66919
+ status: file.status,
66920
+ percentage: file.percentage ?? void 0
66921
+ };
66922
+ }) : void 0;
65949
66923
  handleMessageSend(inputValue.value.trim(), attachments);
65950
66924
  inputValue.value = "";
65951
66925
  attachmentFileList.value = [];
65952
66926
  chatInputs.value[selectedChatRef.value.id] = "";
66927
+ uploadedAttachmentsMap.value.clear();
65953
66928
  hasUnreadMessages.value = false;
65954
66929
  showNotificationManually.value = false;
65955
66930
  } finally {
@@ -65959,44 +66934,25 @@
65959
66934
  }
65960
66935
  }
65961
66936
  };
65962
- let fileUploadTimer = null;
65963
- const pendingFiles = vue.ref([]);
65964
66937
  const handleFileListUpdate = (fileList) => {
65965
- const newFiles = fileList.filter(
65966
- (file) => !attachmentFileList.value.some(
65967
- (existing) => existing.id === file.id
65968
- ) && !pendingFiles.value.some(
65969
- (existing) => existing.id === file.id
65970
- )
65971
- );
65972
- if (newFiles.length > 0) {
65973
- pendingFiles.value = [...pendingFiles.value, ...newFiles];
65974
- if (fileUploadTimer) {
65975
- clearTimeout(fileUploadTimer);
65976
- }
65977
- fileUploadTimer = setTimeout(() => {
65978
- if (pendingFiles.value.length > 0 && handleMessageSend) {
65979
- const hasError = pendingFiles.value.some(
65980
- (file) => file.status === "error"
65981
- );
65982
- const batchStatus = hasError ? "error" : "finished";
65983
- const attachments = pendingFiles.value.map(
65984
- (file) => ({
65985
- id: file.id,
65986
- type: ChatMessageType.FILE,
65987
- name: file.name,
65988
- url: file.url || (file.file ? URL.createObjectURL(file.file) : "#"),
65989
- size: file.file?.size,
65990
- thumbnail: file.thumbnailUrl ?? void 0,
65991
- status: batchStatus,
65992
- percentage: file.percentage ?? void 0
65993
- })
65994
- );
65995
- handleMessageSend("", attachments);
65996
- pendingFiles.value = [];
65997
- attachmentFileList.value = [];
66938
+ attachmentFileList.value = fileList;
66939
+ const uploadCallback = onAttachmentUpload?.value;
66940
+ if (uploadCallback) {
66941
+ const newFiles = fileList.filter(
66942
+ (file) => file.file && !uploadedAttachmentsMap.value.has(file.id)
66943
+ );
66944
+ void (async () => {
66945
+ for (const uploadFile of newFiles) {
66946
+ if (uploadFile.file) {
66947
+ try {
66948
+ const attachment = await uploadCallback(uploadFile.file);
66949
+ uploadedAttachmentsMap.value.set(uploadFile.id, attachment);
66950
+ } catch (error) {
66951
+ console.error("File upload failed:", error);
66952
+ }
66953
+ }
65998
66954
  }
65999
- }, SENDING_DELAY);
66955
+ })();
66000
66956
  }
66001
66957
  };
66002
66958
  const renderFooter = () => {
@@ -66029,6 +66985,7 @@
66029
66985
  size: "large",
66030
66986
  class: `${mergedClsPrefixRef.value}-chat-main__attach-btn`,
66031
66987
  ...footerButtonPropsRef.value,
66988
+ disabled: footerInputPropsRef.value?.disabled,
66032
66989
  theme: mergedThemeRef.value.peers.Button,
66033
66990
  themeOverrides: mergedThemeRef.value.peerOverrides.Button,
66034
66991
  onClick: handleClick
@@ -66093,7 +67050,7 @@
66093
67050
  render() {
66094
67051
  const { mergedClsPrefixRef } = vue.inject(chatInjectionKey);
66095
67052
  return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-main` }, this.renderHeader(), /* @__PURE__ */ vue.h(
66096
- Scrollbar,
67053
+ SafeTopScrollbar,
66097
67054
  {
66098
67055
  ref: "messagesBodyRef",
66099
67056
  class: `${mergedClsPrefixRef.value}-chat-main__body`,
@@ -66296,6 +67253,10 @@
66296
67253
  type: Function,
66297
67254
  default: void 0
66298
67255
  },
67256
+ onAttachmentDownload: {
67257
+ type: Function,
67258
+ default: void 0
67259
+ },
66299
67260
  onFilterChange: {
66300
67261
  type: Function,
66301
67262
  default: void 0
@@ -66611,6 +67572,8 @@
66611
67572
  handleNetworkError,
66612
67573
  handleUploadError,
66613
67574
  handleSendError,
67575
+ onAttachmentUpload: vue.toRef(props, "onAttachmentUpload"),
67576
+ onAttachmentDownload: vue.toRef(props, "onAttachmentDownload"),
66614
67577
  onChatClose: vue.toRef(props, "onChatClose"),
66615
67578
  onChatShare: vue.toRef(props, "onChatShare"),
66616
67579
  onUserProfile: vue.toRef(props, "onUserProfile"),
@@ -108509,6 +109472,10 @@
108509
109472
  type: [Boolean, String],
108510
109473
  required: true
108511
109474
  },
109475
+ maxWidth: Number,
109476
+ maxHeight: Number,
109477
+ minWidth: Number,
109478
+ minHeight: Number,
108512
109479
  resizable: Boolean,
108513
109480
  onClickoutside: Function,
108514
109481
  onAfterLeave: Function,
@@ -108534,9 +109501,9 @@
108534
109501
  startPosition = isVertical.value ? e.clientY : e.clientX;
108535
109502
  memoizedBodyStyleCursor = document.body.style.cursor;
108536
109503
  document.body.style.cursor = isVertical.value ? "ns-resize" : "ew-resize";
108537
- window.addEventListener("mousemove", handleBodyMousemove);
108538
- window.addEventListener("mouseleave", handleBodyMouseleave);
108539
- window.addEventListener("mouseup", handleBodyMouseup);
109504
+ document.body.addEventListener("mousemove", handleBodyMousemove);
109505
+ document.body.addEventListener("mouseleave", handleBodyMouseleave);
109506
+ document.body.addEventListener("mouseup", handleBodyMouseup);
108540
109507
  };
108541
109508
  const handleMouseenterResizeTrigger = () => {
108542
109509
  if (hoverTimerId !== null) {
@@ -108559,31 +109526,55 @@
108559
109526
  isHoverOnResizeTriggerRef.value = false;
108560
109527
  };
108561
109528
  const { doUpdateHeight, doUpdateWidth } = UDrawer;
108562
- const handleBodyMousemove = (e) => {
109529
+ const regulateWidth = (size) => {
109530
+ const { maxWidth } = props;
109531
+ if (maxWidth && size > maxWidth) {
109532
+ return maxWidth;
109533
+ }
109534
+ const { minWidth } = props;
109535
+ if (minWidth && size < minWidth) {
109536
+ return minWidth;
109537
+ }
109538
+ return size;
109539
+ };
109540
+ const regulateHeight = (size) => {
109541
+ const { maxHeight } = props;
109542
+ if (maxHeight && size > maxHeight) {
109543
+ return maxHeight;
109544
+ }
109545
+ const { minHeight } = props;
109546
+ if (minHeight && size < minHeight) {
109547
+ return minHeight;
109548
+ }
109549
+ return size;
109550
+ };
109551
+ function handleBodyMousemove(e) {
108563
109552
  if (isDraggingRef.value) {
108564
109553
  if (isVertical.value) {
108565
109554
  let height = bodyRef.value?.offsetHeight || 0;
108566
109555
  const increment = startPosition - e.clientY;
108567
109556
  height += props.placement === "bottom" ? increment : -increment;
109557
+ height = regulateHeight(height);
108568
109558
  doUpdateHeight(height);
108569
109559
  startPosition = e.clientY;
108570
109560
  } else {
108571
109561
  let width = bodyRef.value?.offsetWidth || 0;
108572
109562
  const increment = startPosition - e.clientX;
108573
109563
  width += props.placement === "right" ? increment : -increment;
109564
+ width = regulateWidth(width);
108574
109565
  doUpdateWidth(width);
108575
109566
  startPosition = e.clientX;
108576
109567
  }
108577
109568
  }
108578
- };
109569
+ }
108579
109570
  const handleBodyMouseup = () => {
108580
109571
  if (isDraggingRef.value) {
108581
109572
  startPosition = 0;
108582
109573
  isDraggingRef.value = false;
108583
109574
  document.body.style.cursor = memoizedBodyStyleCursor;
108584
- window.removeEventListener("mousemove", handleBodyMousemove);
108585
- window.removeEventListener("mouseup", handleBodyMouseup);
108586
- window.removeEventListener("mouseleave", handleBodyMouseleave);
109575
+ document.body.removeEventListener("mousemove", handleBodyMousemove);
109576
+ document.body.removeEventListener("mouseup", handleBodyMouseup);
109577
+ document.body.removeEventListener("mouseleave", handleBodyMouseleave);
108587
109578
  }
108588
109579
  };
108589
109580
  const handleBodyMouseleave = handleBodyMouseup;
@@ -109075,6 +110066,12 @@
109075
110066
  minHeight: Number,
109076
110067
  resizable: Boolean,
109077
110068
  fullscreen: Boolean,
110069
+ defaultWidth: {
110070
+ type: [Number, String]
110071
+ },
110072
+ defaultHeight: {
110073
+ type: [Number, String]
110074
+ },
109078
110075
  onUpdateWidth: [Function, Array],
109079
110076
  onUpdateHeight: [Function, Array],
109080
110077
  "onUpdate:width": [Function, Array],
@@ -109140,8 +110137,8 @@
109140
110137
  props,
109141
110138
  mergedClsPrefixRef
109142
110139
  );
109143
- const uncontrolledWidthRef = vue.ref(sizesWidth[props.size]);
109144
- const uncontrolledHeightRef = vue.ref(sizesHeight[props.size]);
110140
+ const uncontrolledWidthRef = vue.ref(props.defaultWidth || sizesWidth[props.size]);
110141
+ const uncontrolledHeightRef = vue.ref(props.defaultHeight || sizesHeight[props.size]);
109145
110142
  const mergedWidthRef = useMergedState(
109146
110143
  vue.toRef(props, "width"),
109147
110144
  uncontrolledWidthRef
@@ -109162,32 +110159,29 @@
109162
110159
  if (placement === "left" || placement === "right") return "";
109163
110160
  return formatLength(mergedHeightRef.value);
109164
110161
  });
109165
- const doUpdate = (isHeight, value) => {
109166
- let {
109167
- onUpdateWidth: onUpdate,
109168
- "onUpdate:width": _onUpdate,
109169
- maxWidth: max,
109170
- minWidth: min
109171
- } = props;
109172
- let _ref = uncontrolledWidthRef;
109173
- if (isHeight) {
109174
- onUpdate = props.onUpdateHeight;
109175
- _onUpdate = props["onUpdate:height"];
109176
- max = props.maxHeight;
109177
- min = props.minHeight;
109178
- _ref = uncontrolledHeightRef;
109179
- }
109180
- if (max && value > max) value = max;
109181
- if (min && value < min) value = min;
109182
- if (onUpdate) call(onUpdate, value);
109183
- if (_onUpdate) call(_onUpdate, value);
109184
- _ref.value = value;
109185
- };
109186
- const doUpdateWidth = doUpdate.bind(null, false);
109187
- const doUpdateHeight = doUpdate.bind(null, true);
110162
+ const doUpdateWidth = (value) => {
110163
+ const { onUpdateWidth, "onUpdate:width": _onUpdateWidth } = props;
110164
+ if (onUpdateWidth) {
110165
+ call(onUpdateWidth, value);
110166
+ }
110167
+ if (_onUpdateWidth) {
110168
+ call(_onUpdateWidth, value);
110169
+ }
110170
+ uncontrolledWidthRef.value = value;
110171
+ };
110172
+ const doUpdateHeight = (value) => {
110173
+ const { onUpdateHeight, "onUpdate:width": _onUpdateHeight } = props;
110174
+ if (onUpdateHeight) {
110175
+ call(onUpdateHeight, value);
110176
+ }
110177
+ if (_onUpdateHeight) {
110178
+ call(_onUpdateHeight, value);
110179
+ }
110180
+ uncontrolledHeightRef.value = value;
110181
+ };
109188
110182
  vue.watchEffect(() => {
109189
- doUpdateWidth(sizesWidth[props.size]);
109190
- doUpdateHeight(sizesHeight[props.size]);
110183
+ doUpdateWidth(Number(props.defaultWidth || sizesWidth[props.size]));
110184
+ doUpdateHeight(Number(props.defaultHeight || sizesHeight[props.size]));
109191
110185
  });
109192
110186
  const mergedBodyStyleRef = vue.computed(() => {
109193
110187
  return [
@@ -109373,6 +110367,10 @@
109373
110367
  trapFocus: this.trapFocus,
109374
110368
  autoFocus: this.autoFocus,
109375
110369
  resizable: this.resizable,
110370
+ maxHeight: this.maxHeight,
110371
+ minHeight: this.minHeight,
110372
+ maxWidth: this.maxWidth,
110373
+ minWidth: this.minWidth,
109376
110374
  showMask: this.showMask,
109377
110375
  onEsc: this.handleEsc,
109378
110376
  onClickoutside: this.handleMaskClick
@@ -135003,6 +136001,7 @@
135003
136001
  URate: Rate,
135004
136002
  UResult: Result,
135005
136003
  URow: URow,
136004
+ USafeTopScrollbar: SafeTopScrollbar,
135006
136005
  UScrollbar: Scrollbar,
135007
136006
  USelect: USelect,
135008
136007
  USkeleton: USkeleton,
@@ -135149,6 +136148,7 @@
135149
136148
  rateProps: rateProps,
135150
136149
  resultProps: resultProps,
135151
136150
  rowProps: rowProps,
136151
+ safeTopScrollbarProps: safeTopScrollbarProps,
135152
136152
  scrollbarProps: scrollbarProps,
135153
136153
  selectProps: selectProps,
135154
136154
  skeletonProps: skeletonProps,
@@ -135187,7 +136187,7 @@
135187
136187
  watermarkProps: watermarkProps
135188
136188
  });
135189
136189
 
135190
- var version = "1.10.1";
136190
+ var version = "1.11.0";
135191
136191
 
135192
136192
  function create({
135193
136193
  componentPrefix = "U",
@@ -135329,6 +136329,7 @@
135329
136329
  Result: resultDark,
135330
136330
  Row: rowDark,
135331
136331
  Scrollbar: scrollbarDark,
136332
+ SafeTopScrollbar: safeTopScrollbarDark,
135332
136333
  Select: selectDark,
135333
136334
  Skeleton: skeletonDark,
135334
136335
  Slider: sliderDark,
@@ -135425,6 +136426,7 @@
135425
136426
  Row: rowLight,
135426
136427
  Result: resultLight,
135427
136428
  Scrollbar: scrollbarLight,
136429
+ SafeTopScrollbar: safeTopScrollbarLight,
135428
136430
  Skeleton: skeletonLight,
135429
136431
  Select: selectLight,
135430
136432
  Slider: sliderLight,
@@ -136114,6 +137116,7 @@
136114
137116
  exports.URate = Rate;
136115
137117
  exports.UResult = Result;
136116
137118
  exports.URow = URow;
137119
+ exports.USafeTopScrollbar = SafeTopScrollbar;
136117
137120
  exports.UScrollbar = Scrollbar;
136118
137121
  exports.USelect = USelect;
136119
137122
  exports.USkeleton = USkeleton;
@@ -136369,6 +137372,7 @@
136369
137372
  exports.resultProps = resultProps;
136370
137373
  exports.rowProps = rowProps;
136371
137374
  exports.ruRU = ruRu;
137375
+ exports.safeTopScrollbarProps = safeTopScrollbarProps;
136372
137376
  exports.scrollbarDark = scrollbarDark;
136373
137377
  exports.scrollbarProps = scrollbarProps;
136374
137378
  exports.selectDark = selectDark;