@expcat/tigercat-vue 2.0.0-rc.2 → 2.0.4

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 (183) hide show
  1. package/dist/{chunk-KE6RGD4Y.mjs → chunk-26OI3TEA.mjs} +25 -55
  2. package/dist/{chunk-H26JXVJX.mjs → chunk-2T2NEZRZ.mjs} +1 -1
  3. package/dist/chunk-4HUYX5WW.mjs +239 -0
  4. package/dist/{chunk-EGIQPUEL.mjs → chunk-5C32WCQY.mjs} +8 -6
  5. package/dist/{chunk-QFG452MD.mjs → chunk-5RXYJWNA.mjs} +53 -28
  6. package/dist/{chunk-IDUEWMWN.mjs → chunk-7KCOF5US.mjs} +61 -62
  7. package/dist/{chunk-RHV6DWY6.mjs → chunk-7VHXZX7Y.mjs} +20 -28
  8. package/dist/{chunk-36TZA5BH.mjs → chunk-A5QYJSHK.mjs} +0 -3
  9. package/dist/{chunk-IZRQ7LB3.mjs → chunk-AU6IC6K7.mjs} +1 -1
  10. package/dist/{chunk-O6BN5R6J.mjs → chunk-AUMTHL6N.mjs} +1 -1
  11. package/dist/{chunk-MNSVJBNH.mjs → chunk-B4MDHE3L.mjs} +18 -4
  12. package/dist/{chunk-7JT5ZIHC.mjs → chunk-BCU7GYF6.mjs} +16 -8
  13. package/dist/{chunk-7CPMXNLK.mjs → chunk-BNYA5IUB.mjs} +26 -2
  14. package/dist/{chunk-N7LWKAYS.mjs → chunk-BZ6MVFV7.mjs} +190 -174
  15. package/dist/{chunk-TK3QU367.mjs → chunk-DI6RRAGQ.mjs} +3 -3
  16. package/dist/{chunk-4ZZYQITT.mjs → chunk-FWO7RNGI.mjs} +249 -220
  17. package/dist/{chunk-SUORTZUY.mjs → chunk-GS4SV2HK.mjs} +48 -20
  18. package/dist/{chunk-EUSODI5E.mjs → chunk-HKYRRQS7.mjs} +11 -5
  19. package/dist/{chunk-D4APFWWS.mjs → chunk-IPGPLFUZ.mjs} +18 -4
  20. package/dist/{chunk-IMFHJEUX.mjs → chunk-JALHMWKW.mjs} +20 -7
  21. package/dist/{chunk-OHPXOLNB.mjs → chunk-K3WTQBE4.mjs} +40 -15
  22. package/dist/{chunk-VMYV5EWI.mjs → chunk-KICZSLOX.mjs} +9 -8
  23. package/dist/{chunk-BNNTDSLJ.mjs → chunk-KROVW4AW.mjs} +19 -60
  24. package/dist/{chunk-AQMPCLX7.mjs → chunk-NMAJD353.mjs} +248 -253
  25. package/dist/{chunk-4BO6JNA6.mjs → chunk-OAPIT53X.mjs} +4 -4
  26. package/dist/{chunk-SYRRMZT2.mjs → chunk-OQVGB7X6.mjs} +43 -29
  27. package/dist/{chunk-DWK5GUMB.mjs → chunk-OTGGPXDT.mjs} +26 -19
  28. package/dist/{chunk-5KPO3EDM.mjs → chunk-OTHJIFDV.mjs} +28 -15
  29. package/dist/{chunk-DWPZRG7A.mjs → chunk-PGF7HLLR.mjs} +43 -39
  30. package/dist/chunk-Q7Y22OFX.mjs +330 -0
  31. package/dist/{chunk-3NQUEQJT.mjs → chunk-RID7A5V7.mjs} +54 -38
  32. package/dist/{chunk-CFH5T3V2.mjs → chunk-S5RTMAQN.mjs} +2 -2
  33. package/dist/{chunk-SJ7W5I5H.mjs → chunk-TCV6YPH5.mjs} +1 -1
  34. package/dist/{chunk-LFENEILY.mjs → chunk-WC5MKASU.mjs} +110 -99
  35. package/dist/{chunk-JZCETBUV.mjs → chunk-WUQMFKQ6.mjs} +29 -16
  36. package/dist/{chunk-GWFVBG22.mjs → chunk-XGXZF27U.mjs} +28 -15
  37. package/dist/{chunk-JVQPU4M2.mjs → chunk-ZGA66PSG.mjs} +28 -15
  38. package/dist/components/ActivityFeed.d.mts +6 -6
  39. package/dist/components/ActivityFeed.mjs +3 -3
  40. package/dist/components/Alert.d.mts +3 -3
  41. package/dist/components/Anchor.d.mts +1 -1
  42. package/dist/components/AreaChart.d.mts +3 -3
  43. package/dist/components/AreaChart.mjs +1 -1
  44. package/dist/components/AutoComplete.d.mts +5 -5
  45. package/dist/components/AutoComplete.mjs +2 -1
  46. package/dist/components/Avatar.d.mts +1 -1
  47. package/dist/components/AvatarGroup.d.mts +2 -2
  48. package/dist/components/BackTop.d.mts +3 -3
  49. package/dist/components/Badge.d.mts +4 -4
  50. package/dist/components/BarChart.d.mts +2 -2
  51. package/dist/components/BarChart.mjs +1 -1
  52. package/dist/components/Breadcrumb.d.mts +3 -3
  53. package/dist/components/Button.d.mts +3 -3
  54. package/dist/components/ButtonGroup.d.mts +1 -1
  55. package/dist/components/Calendar.d.mts +2 -2
  56. package/dist/components/Card.d.mts +2 -2
  57. package/dist/components/Carousel.d.mts +2 -2
  58. package/dist/components/Cascader.d.mts +3 -3
  59. package/dist/components/Cascader.mjs +2 -1
  60. package/dist/components/ChartCanvas.d.mts +1 -1
  61. package/dist/components/ChartGrid.d.mts +1 -1
  62. package/dist/components/ChartLegend.d.mts +1 -1
  63. package/dist/components/ChatWindow.d.mts +4 -4
  64. package/dist/components/CodeEditor.d.mts +3 -3
  65. package/dist/components/Collapse.d.mts +1 -1
  66. package/dist/components/CollapsePanel.d.mts +1 -1
  67. package/dist/components/ColorPicker.mjs +2 -1
  68. package/dist/components/ColorSwatch.d.mts +2 -2
  69. package/dist/components/CommentThread.d.mts +2 -2
  70. package/dist/components/CommentThread.mjs +1 -1
  71. package/dist/components/ConfigProvider.d.mts +1 -1
  72. package/dist/components/Container.d.mts +1 -1
  73. package/dist/components/Countdown.d.mts +2 -2
  74. package/dist/components/CronEditor.d.mts +2 -2
  75. package/dist/components/CropUpload.d.mts +1 -1
  76. package/dist/components/CropUpload.mjs +4 -4
  77. package/dist/components/DataExport.d.mts +2 -2
  78. package/dist/components/DataExport.mjs +3 -3
  79. package/dist/components/DataTableWithToolbar.d.mts +11 -11
  80. package/dist/components/DataTableWithToolbar.mjs +6 -6
  81. package/dist/components/DatePicker.d.mts +3 -3
  82. package/dist/components/DatePicker.mjs +2 -1
  83. package/dist/components/Descriptions.d.mts +2 -2
  84. package/dist/components/DonutChart.d.mts +4 -4
  85. package/dist/components/Drawer.d.mts +6 -6
  86. package/dist/components/Drawer.mjs +2 -2
  87. package/dist/components/Dropdown.d.mts +2 -2
  88. package/dist/components/Dropdown.mjs +2 -2
  89. package/dist/components/Empty.d.mts +1 -1
  90. package/dist/components/FileManager.d.mts +2 -2
  91. package/dist/components/FloatButton.d.mts +5 -5
  92. package/dist/components/Form.d.mts +2 -2
  93. package/dist/components/FormItem.mjs +2 -1
  94. package/dist/components/FormWizard.d.mts +5 -5
  95. package/dist/components/FunnelChart.d.mts +3 -3
  96. package/dist/components/Gantt.d.mts +2 -2
  97. package/dist/components/GaugeChart.d.mts +2 -2
  98. package/dist/components/HeatmapChart.d.mts +3 -3
  99. package/dist/components/Icon.d.mts +2 -2
  100. package/dist/components/Image.d.mts +2 -2
  101. package/dist/components/Image.mjs +3 -3
  102. package/dist/components/ImageAnnotation.d.mts +5 -5
  103. package/dist/components/ImageCropper.d.mts +1 -1
  104. package/dist/components/ImageCropper.mjs +1 -1
  105. package/dist/components/ImageViewer.d.mts +1 -1
  106. package/dist/components/InfiniteScroll.d.mts +3 -3
  107. package/dist/components/InfiniteScroll.mjs +1 -1
  108. package/dist/components/Input.d.mts +4 -4
  109. package/dist/components/InputGroup.d.mts +1 -1
  110. package/dist/components/InputNumber.d.mts +1 -1
  111. package/dist/components/Kanban.d.mts +1 -1
  112. package/dist/components/LineChart.d.mts +2 -2
  113. package/dist/components/LineChart.mjs +1 -1
  114. package/dist/components/Link.d.mts +1 -1
  115. package/dist/components/List.d.mts +7 -7
  116. package/dist/components/Loading.d.mts +6 -6
  117. package/dist/components/Loading.mjs +2 -2
  118. package/dist/components/MarkdownEditor.d.mts +5 -5
  119. package/dist/components/Mentions.d.mts +3 -3
  120. package/dist/components/Mentions.mjs +2 -1
  121. package/dist/components/Menu.d.mts +4 -4
  122. package/dist/components/Menu.mjs +2 -2
  123. package/dist/components/Modal.d.mts +8 -8
  124. package/dist/components/Modal.mjs +2 -2
  125. package/dist/components/NotificationCenter.d.mts +5 -5
  126. package/dist/components/NotificationCenter.mjs +3 -3
  127. package/dist/components/NumberKeyboard.d.mts +5 -5
  128. package/dist/components/OrgChart.d.mts +3 -3
  129. package/dist/components/Pagination.d.mts +5 -5
  130. package/dist/components/PieChart.d.mts +4 -4
  131. package/dist/components/Popconfirm.d.mts +4 -4
  132. package/dist/components/Popconfirm.mjs +3 -3
  133. package/dist/components/Popover.d.mts +3 -3
  134. package/dist/components/Popover.mjs +3 -3
  135. package/dist/components/Progress.d.mts +3 -3
  136. package/dist/components/QRCode.d.mts +3 -3
  137. package/dist/components/RadarChart.d.mts +3 -3
  138. package/dist/components/Rate.d.mts +2 -2
  139. package/dist/components/Result.d.mts +1 -1
  140. package/dist/components/RichTextEditor.d.mts +4 -4
  141. package/dist/components/Row.d.mts +1 -1
  142. package/dist/components/ScatterChart.d.mts +2 -2
  143. package/dist/components/ScatterChart.mjs +1 -1
  144. package/dist/components/ScrollSpy.d.mts +3 -3
  145. package/dist/components/Select.d.mts +3 -3
  146. package/dist/components/Select.mjs +2 -1
  147. package/dist/components/Signature.d.mts +5 -5
  148. package/dist/components/Skeleton.d.mts +1 -1
  149. package/dist/components/Space.d.mts +2 -2
  150. package/dist/components/Splitter.d.mts +1 -1
  151. package/dist/components/Spotlight.d.mts +5 -5
  152. package/dist/components/Spotlight.mjs +2 -2
  153. package/dist/components/Steps.d.mts +3 -3
  154. package/dist/components/SunburstChart.d.mts +2 -2
  155. package/dist/components/Table.d.mts +5 -5
  156. package/dist/components/Table.mjs +3 -2
  157. package/dist/components/Tabs.d.mts +4 -4
  158. package/dist/components/Tag.d.mts +2 -2
  159. package/dist/components/TaskBoard.d.mts +2 -2
  160. package/dist/components/Text.d.mts +3 -3
  161. package/dist/components/Textarea.d.mts +3 -3
  162. package/dist/components/TimePicker.d.mts +4 -4
  163. package/dist/components/TimePicker.mjs +2 -1
  164. package/dist/components/Timeline.d.mts +4 -4
  165. package/dist/components/Tooltip.d.mts +3 -3
  166. package/dist/components/Tooltip.mjs +3 -3
  167. package/dist/components/Tour.d.mts +2 -2
  168. package/dist/components/Tour.mjs +2 -2
  169. package/dist/components/Transfer.d.mts +3 -3
  170. package/dist/components/Tree.d.mts +4 -4
  171. package/dist/components/TreeMapChart.d.mts +2 -2
  172. package/dist/components/TreeSelect.d.mts +3 -3
  173. package/dist/components/TreeSelect.mjs +2 -1
  174. package/dist/components/Upload.d.mts +4 -4
  175. package/dist/components/Upload.mjs +1 -1
  176. package/dist/components/VirtualTable.d.mts +3 -3
  177. package/dist/components/VirtualTable.mjs +1 -1
  178. package/dist/components/Watermark.d.mts +1 -1
  179. package/dist/index.d.mts +1 -1
  180. package/dist/index.mjs +4 -2
  181. package/package.json +2 -2
  182. package/dist/chunk-BDTPFPSB.mjs +0 -163
  183. package/dist/chunk-EWUHEW6W.mjs +0 -219
@@ -1,17 +1,13 @@
1
+ import {
2
+ renderVueOverlayTeleport,
3
+ useVueAnchoredOverlay
4
+ } from "./chunk-Q7Y22OFX.mjs";
1
5
  import {
2
6
  useTigerConfig
3
7
  } from "./chunk-UOJOJBEU.mjs";
4
8
 
5
9
  // src/components/AutoComplete.ts
6
- import {
7
- defineComponent,
8
- h,
9
- ref,
10
- computed,
11
- watch,
12
- onBeforeUnmount,
13
- nextTick
14
- } from "vue";
10
+ import { defineComponent, h, ref, computed, watch, nextTick } from "vue";
15
11
  import {
16
12
  resolveLocaleText,
17
13
  mergeTigerLocale,
@@ -119,6 +115,20 @@ var AutoComplete = defineComponent({
119
115
  const activeIndex = ref(-1);
120
116
  const containerRef = ref(null);
121
117
  const inputRef = ref(null);
118
+ const dropdownRef = ref(null);
119
+ const overlay = useVueAnchoredOverlay({
120
+ enabled: isOpen,
121
+ referenceRef: inputRef,
122
+ floatingRef: dropdownRef,
123
+ containerRef,
124
+ placement: "bottom-start",
125
+ offset: 4,
126
+ matchReferenceWidth: true,
127
+ dismissOnOutside: true,
128
+ dismissOnEscape: true,
129
+ restoreFocusOnDismiss: true,
130
+ onDismiss: closeDropdown
131
+ });
122
132
  const filteredOptions = computed(
123
133
  () => filterAutoCompleteOptions(props.options, inputValue.value, props.filterOption)
124
134
  );
@@ -234,21 +244,6 @@ var AutoComplete = defineComponent({
234
244
  break;
235
245
  }
236
246
  }
237
- function handleClickOutside(e) {
238
- if (containerRef.value && !containerRef.value.contains(e.target)) {
239
- closeDropdown();
240
- }
241
- }
242
- watch(isOpen, (val) => {
243
- if (val) {
244
- document.addEventListener("click", handleClickOutside);
245
- } else {
246
- document.removeEventListener("click", handleClickOutside);
247
- }
248
- });
249
- onBeforeUnmount(() => {
250
- document.removeEventListener("click", handleClickOutside);
251
- });
252
247
  return () => {
253
248
  const containerClasses = classNames(autoCompleteBaseClasses, coerceClassValue(attrs.class));
254
249
  const options = filteredOptions.value;
@@ -290,45 +285,49 @@ var AutoComplete = defineComponent({
290
285
  [ClearIcon]
291
286
  ) : null,
292
287
  // Dropdown
293
- isOpen.value && options.length > 0 ? h(
294
- "div",
295
- {
296
- ...getPickerListboxAria({ id: listboxId }),
297
- class: autoCompleteDropdownClasses
298
- },
299
- options.map(
300
- (option, index) => h(
301
- "div",
302
- {
303
- id: getPickerOptionId(listboxId, index),
304
- ...getPickerOptionAria({
305
- selected: String(option.value) === String(props.modelValue),
306
- disabled: !!option.disabled
307
- }),
308
- class: getAutoCompleteOptionClasses(
309
- String(option.value) === String(props.modelValue),
310
- !!option.disabled,
311
- props.size
312
- ),
313
- onMousedown: (e) => e.preventDefault(),
314
- onClick: () => handleSelect(option),
315
- onMouseenter: () => {
316
- activeIndex.value = index;
317
- }
318
- },
319
- option.label
288
+ isOpen.value && (options.length > 0 || inputValue.value) ? renderVueOverlayTeleport(
289
+ h(
290
+ "div",
291
+ {
292
+ ref: dropdownRef,
293
+ ...options.length > 0 ? getPickerListboxAria({ id: listboxId }) : {},
294
+ class: classNames(
295
+ autoCompleteDropdownClasses,
296
+ options.length === 0 && autoCompleteEmptyStateClasses,
297
+ overlay.floatingClasses.value
298
+ ),
299
+ style: overlay.floatingStyles.value,
300
+ "data-positioned": overlay.positioned.value
301
+ },
302
+ options.length > 0 ? options.map(
303
+ (option, index) => h(
304
+ "div",
305
+ {
306
+ id: getPickerOptionId(listboxId, index),
307
+ ...getPickerOptionAria({
308
+ selected: String(option.value) === String(props.modelValue),
309
+ disabled: !!option.disabled
310
+ }),
311
+ class: getAutoCompleteOptionClasses(
312
+ String(option.value) === String(props.modelValue),
313
+ !!option.disabled,
314
+ props.size
315
+ ),
316
+ onMousedown: (e) => e.preventDefault(),
317
+ onClick: () => handleSelect(option),
318
+ onMouseenter: () => {
319
+ activeIndex.value = index;
320
+ }
321
+ },
322
+ option.label
323
+ )
324
+ ) : resolveLocaleText(
325
+ "No matches found",
326
+ props.emptyText,
327
+ mergedLocale.value?.common?.emptyText
320
328
  )
321
- )
322
- ) : isOpen.value && inputValue.value && options.length === 0 ? h(
323
- "div",
324
- {
325
- class: classNames(autoCompleteDropdownClasses, autoCompleteEmptyStateClasses)
326
- },
327
- resolveLocaleText(
328
- "No matches found",
329
- props.emptyText,
330
- mergedLocale.value?.common?.emptyText
331
- )
329
+ ),
330
+ overlay.target.value
332
331
  ) : null
333
332
  ]
334
333
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
- renderVueBodyTeleport,
3
- useVueFloating
4
- } from "./chunk-BDTPFPSB.mjs";
2
+ renderVueOverlayTeleport,
3
+ useVueAnchoredOverlay
4
+ } from "./chunk-Q7Y22OFX.mjs";
5
5
 
6
6
  // src/components/Menu.ts
7
7
  import {
@@ -26,8 +26,6 @@ import {
26
26
  getMenuItemIndent,
27
27
  getSubMenuTitleClasses,
28
28
  getSubMenuExpandIconClasses,
29
- getSubmenuPopupZIndex,
30
- getTransformOrigin,
31
29
  filterMenuItems,
32
30
  isKeySelected,
33
31
  isKeyOpen,
@@ -679,16 +677,18 @@ var SubMenu = defineComponent({
679
677
  const popupPlacement = computed(
680
678
  () => menuContext?.mode.value === "horizontal" && props.level === 0 ? "bottom-start" : "right-start"
681
679
  );
682
- const {
683
- x: popupX,
684
- y: popupY,
685
- placement: currentPopupPlacement
686
- } = useVueFloating({
680
+ const overlay = useVueAnchoredOverlay({
687
681
  referenceRef: titleEl,
688
682
  floatingRef: popupEl,
689
- enabled: computed(() => popupPortal.value && isExpanded.value),
683
+ enabled: computed(() => isPopup.value && isExpanded.value),
690
684
  placement: popupPlacement.value,
691
- offset: 4
685
+ offset: 4,
686
+ portal: popupPortal,
687
+ dismissOnEscape: true,
688
+ onDismiss: () => {
689
+ isOpenByKeyboard.value = false;
690
+ isHovered.value = false;
691
+ }
692
692
  });
693
693
  const disposeHeightTransition = () => {
694
694
  heightTransitionController?.dispose();
@@ -748,7 +748,6 @@ var SubMenu = defineComponent({
748
748
  if (menuContext.mode.value === "inline") return submenuContentInlineClasses;
749
749
  return submenuContentVerticalClasses;
750
750
  });
751
- const popupZIndex = computed(() => isPopup.value ? getSubmenuPopupZIndex(props.level) : {});
752
751
  const handleTitleClick = () => {
753
752
  if (!menuContext || props.disabled) return;
754
753
  if (menuContext.mode.value === "horizontal") return;
@@ -933,23 +932,16 @@ var SubMenu = defineComponent({
933
932
  titleChildren
934
933
  );
935
934
  const popupContentNode = () => {
936
- const popupStyle = popupPortal.value ? {
937
- display: isExpanded.value ? "block" : "none",
938
- position: "absolute",
939
- left: `${popupX.value}px`,
940
- top: `${popupY.value}px`,
941
- transformOrigin: getTransformOrigin(currentPopupPlacement.value),
942
- ...popupZIndex.value
943
- } : {
944
- display: isExpanded.value ? "block" : "none",
945
- ...popupZIndex.value
946
- };
947
935
  const node = h(
948
936
  "ul",
949
937
  {
950
- ref: popupPortal.value ? popupEl : void 0,
951
- class: contentClasses.value,
952
- style: popupStyle,
938
+ ref: popupEl,
939
+ class: classNames(contentClasses.value, overlay.floatingClasses.value),
940
+ style: {
941
+ ...overlay.floatingStyles.value,
942
+ display: isExpanded.value ? "block" : "none"
943
+ },
944
+ "data-positioned": overlay.positioned.value,
953
945
  role: "menu",
954
946
  "aria-hidden": isExpanded.value ? void 0 : "true",
955
947
  onMouseenter: popupPortal.value ? handleMouseEnter : void 0,
@@ -958,7 +950,7 @@ var SubMenu = defineComponent({
958
950
  },
959
951
  withChildLevel(slots.default?.())
960
952
  );
961
- return popupPortal.value ? renderVueBodyTeleport(node) : node;
953
+ return renderVueOverlayTeleport(node, overlay.target.value, !popupPortal.value);
962
954
  };
963
955
  const contentNode = isPopup.value ? popupContentNode() : hasRenderedInline.value ? h(
964
956
  "div",
@@ -41,7 +41,6 @@ var InfiniteScroll = defineComponent({
41
41
  const containerRef = ref(null);
42
42
  const sentinelRef = ref(null);
43
43
  let cleanupObserver = null;
44
- let _usingFallback = false;
45
44
  const containerClasses = computed(
46
45
  () => classNames(
47
46
  getInfiniteScrollContainerClasses(props.direction, props.className),
@@ -63,7 +62,6 @@ var InfiniteScroll = defineComponent({
63
62
  function setupObserver() {
64
63
  cleanupObserver?.();
65
64
  cleanupObserver = null;
66
- _usingFallback = false;
67
65
  if (props.disabled || !props.hasMore) return;
68
66
  const sentinel = sentinelRef.value;
69
67
  if (!sentinel) return;
@@ -77,7 +75,6 @@ var InfiniteScroll = defineComponent({
77
75
  if (teardown) {
78
76
  cleanupObserver = teardown;
79
77
  } else {
80
- _usingFallback = true;
81
78
  containerRef.value?.addEventListener("scroll", checkScroll, { passive: true });
82
79
  cleanupObserver = () => {
83
80
  containerRef.value?.removeEventListener("scroll", checkScroll);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Select
3
- } from "./chunk-N7LWKAYS.mjs";
3
+ } from "./chunk-BZ6MVFV7.mjs";
4
4
  import {
5
5
  Radio
6
6
  } from "./chunk-6BDDX2R4.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  renderVueBodyTeleport,
3
3
  useVueBodyScrollLock
4
- } from "./chunk-BDTPFPSB.mjs";
4
+ } from "./chunk-Q7Y22OFX.mjs";
5
5
  import {
6
6
  useTigerConfig
7
7
  } from "./chunk-UOJOJBEU.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  useVueBodyScrollLock,
4
4
  useVueEscapeKey,
5
5
  useVueFocusTrap
6
- } from "./chunk-BDTPFPSB.mjs";
6
+ } from "./chunk-Q7Y22OFX.mjs";
7
7
  import {
8
8
  useTigerConfig
9
9
  } from "./chunk-UOJOJBEU.mjs";
@@ -221,6 +221,7 @@ var Drawer = defineComponent({
221
221
  const hasBeenOpened = ref(false);
222
222
  const deferredRendered = ref(props.open);
223
223
  const dialogRef = ref(null);
224
+ const rootRef = ref(null);
224
225
  const closeButtonRef = ref(null);
225
226
  const previousActiveElement = ref(null);
226
227
  let touchStartPoint = null;
@@ -276,11 +277,12 @@ var Drawer = defineComponent({
276
277
  const escapeEnabled = computed(() => props.open);
277
278
  let cleanupEscape;
278
279
  useVueBodyScrollLock(escapeEnabled);
279
- useVueFocusTrap({ enabled: escapeEnabled, containerRef: dialogRef });
280
+ useVueFocusTrap({ enabled: escapeEnabled, containerRef: rootRef });
280
281
  onMounted(() => {
281
282
  cleanupEscape = useVueEscapeKey({
282
283
  enabled: escapeEnabled,
283
- onEscape: handleClose
284
+ onEscape: handleClose,
285
+ layerRef: rootRef
284
286
  });
285
287
  });
286
288
  onBeforeUnmount(() => {
@@ -324,6 +326,7 @@ var Drawer = defineComponent({
324
326
  );
325
327
  const ariaLabelledbyFromAttrs = typeof attrs["aria-labelledby"] === "string" ? attrs["aria-labelledby"] : void 0;
326
328
  const ariaLabelledby = ariaLabelledbyFromAttrs ?? (props.title || slots.header ? titleId.value : void 0);
329
+ const overlayHostId = `${instanceId.value}-overlay-host`;
327
330
  const containerClasses = classNames(
328
331
  getDrawerContainerClasses(),
329
332
  !props.open && "pointer-events-none"
@@ -409,6 +412,7 @@ var Drawer = defineComponent({
409
412
  role: "dialog",
410
413
  "aria-modal": "true",
411
414
  "aria-labelledby": ariaLabelledby,
415
+ "aria-owns": overlayHostId,
412
416
  tabindex: -1,
413
417
  ref: dialogRef,
414
418
  onTouchstart: handleTouchStart,
@@ -423,12 +427,22 @@ var Drawer = defineComponent({
423
427
  "div",
424
428
  {
425
429
  class: containerClasses,
430
+ ref: rootRef,
426
431
  style: { zIndex: props.zIndex },
427
432
  hidden: !props.open && !(props.destroyOnClose && props.deferDestroyOnClose),
428
433
  "aria-hidden": !props.open ? "true" : void 0,
434
+ "data-tiger-overlay-layer": "",
429
435
  "data-tiger-drawer-root": ""
430
436
  },
431
- [mask, panel]
437
+ [
438
+ mask,
439
+ panel,
440
+ h("div", {
441
+ id: overlayHostId,
442
+ class: "contents",
443
+ "data-tiger-overlay-host": ""
444
+ })
445
+ ]
432
446
  );
433
447
  return renderVueBodyTeleport([root]);
434
448
  };
@@ -31,6 +31,7 @@ import {
31
31
  getImageEditorLabels,
32
32
  mergeTigerLocale
33
33
  } from "@expcat/tigercat-core";
34
+ var isPositiveFinite = (value) => Number.isFinite(value) && value > 0;
34
35
  var ImageCropper = defineComponent({
35
36
  name: "TigerImageCropper",
36
37
  inheritAttrs: false,
@@ -73,20 +74,27 @@ var ImageCropper = defineComponent({
73
74
  const dragStartPos = ref({ x: 0, y: 0 });
74
75
  const dragStartRect = ref({ x: 0, y: 0, width: 0, height: 0 });
75
76
  const loadImage = () => {
77
+ imageRef.value = null;
76
78
  const img = new window.Image();
77
79
  img.crossOrigin = "anonymous";
78
80
  img.onload = () => {
79
- imageRef.value = img;
81
+ const naturalWidth = img.naturalWidth;
82
+ const naturalHeight = img.naturalHeight;
83
+ if (!isPositiveFinite(naturalWidth) || !isPositiveFinite(naturalHeight)) return;
80
84
  if (containerRef.value) {
81
- const containerW = containerRef.value.clientWidth;
82
- const containerH = containerRef.value.clientHeight || 400;
83
- const ratio = Math.min(containerW / img.naturalWidth, containerH / img.naturalHeight, 1);
84
- displayWidth.value = img.naturalWidth * ratio;
85
- displayHeight.value = img.naturalHeight * ratio;
85
+ const measuredWidth = containerRef.value.clientWidth;
86
+ const measuredHeight = containerRef.value.clientHeight;
87
+ const containerW = isPositiveFinite(measuredWidth) ? measuredWidth : naturalWidth;
88
+ const containerH = isPositiveFinite(measuredHeight) ? measuredHeight : 400;
89
+ const ratio = Math.min(containerW / naturalWidth, containerH / naturalHeight, 1);
90
+ displayWidth.value = naturalWidth * ratio;
91
+ displayHeight.value = naturalHeight * ratio;
86
92
  } else {
87
- displayWidth.value = img.naturalWidth;
88
- displayHeight.value = img.naturalHeight;
93
+ displayWidth.value = naturalWidth;
94
+ displayHeight.value = naturalHeight;
89
95
  }
96
+ if (!isPositiveFinite(displayWidth.value) || !isPositiveFinite(displayHeight.value)) return;
97
+ imageRef.value = img;
90
98
  cropRect.value = getInitialCropRect(
91
99
  displayWidth.value,
92
100
  displayHeight.value,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-UOJOJBEU.mjs";
4
4
 
5
5
  // src/components/Upload.ts
6
- import { defineComponent, ref, computed, watch, h } from "vue";
6
+ import { defineComponent, ref, computed, watch, h, onBeforeUnmount } from "vue";
7
7
  import {
8
8
  classNames,
9
9
  coerceClassValue,
@@ -216,6 +216,23 @@ var Upload = defineComponent({
216
216
  }
217
217
  return internalFileList.value;
218
218
  });
219
+ const objectUrls = /* @__PURE__ */ new Map();
220
+ const revokeUnusedObjectUrls = (files) => {
221
+ const activeFiles = new Set(
222
+ files.flatMap((file) => file.file && !file.url ? [file.file] : [])
223
+ );
224
+ objectUrls.forEach((url, file) => {
225
+ if (!activeFiles.has(file)) {
226
+ URL.revokeObjectURL(url);
227
+ objectUrls.delete(file);
228
+ }
229
+ });
230
+ };
231
+ watch(fileListValue, revokeUnusedObjectUrls, { deep: true });
232
+ onBeforeUnmount(() => {
233
+ objectUrls.forEach((url) => URL.revokeObjectURL(url));
234
+ objectUrls.clear();
235
+ });
219
236
  const setFileList = (value) => {
220
237
  if (!isControlled.value) {
221
238
  internalFileList.value = value;
@@ -597,7 +614,14 @@ var Upload = defineComponent({
597
614
  );
598
615
  };
599
616
  const renderPictureCard = (file) => {
600
- const imageUrl = file.url || (file.file ? URL.createObjectURL(file.file) : "");
617
+ let imageUrl = file.url ?? "";
618
+ if (!imageUrl && file.file && typeof URL !== "undefined" && typeof URL.createObjectURL === "function") {
619
+ imageUrl = objectUrls.get(file.file) ?? "";
620
+ if (!imageUrl) {
621
+ imageUrl = URL.createObjectURL(file.file);
622
+ objectUrls.set(file.file, imageUrl);
623
+ }
624
+ }
601
625
  return h(
602
626
  "div",
603
627
  {