@expcat/tigercat-react 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.
- package/dist/{chunk-JTFNGXOC.mjs → chunk-2ENQZECC.mjs} +53 -31
- package/dist/{chunk-O5RAMCBV.mjs → chunk-2JYJPNW3.mjs} +1 -1
- package/dist/{chunk-POP3TS4Q.mjs → chunk-2WGEHH5A.mjs} +57 -29
- package/dist/{chunk-K7MYQISG.mjs → chunk-54HN5BXW.mjs} +10 -4
- package/dist/chunk-5CKMYMTS.mjs +292 -0
- package/dist/{chunk-Y7K27DVV.mjs → chunk-6H5Y7Y6E.mjs} +42 -28
- package/dist/chunk-6MGQAJ62.mjs +203 -0
- package/dist/{chunk-TO2URY7X.mjs → chunk-7AFRHC7P.mjs} +90 -61
- package/dist/{chunk-MGQWVJHX.mjs → chunk-ALSOPYM5.mjs} +69 -62
- package/dist/{chunk-N6JNLJIN.mjs → chunk-BOGOQ44C.mjs} +6 -2
- package/dist/{chunk-Q327ESD2.mjs → chunk-BUXHI6UK.mjs} +17 -38
- package/dist/{chunk-TORX7SG4.mjs → chunk-CC7IOSNI.mjs} +10 -4
- package/dist/{chunk-OVE2ZUJJ.mjs → chunk-D33BIMGK.mjs} +1 -1
- package/dist/{chunk-PYDWF4ED.mjs → chunk-D3KP72UC.mjs} +34 -9
- package/dist/{chunk-ZEP7I6WB.mjs → chunk-DPWRXXXW.mjs} +16 -8
- package/dist/{chunk-44CQTGAN.mjs → chunk-E7OTDBI6.mjs} +2 -2
- package/dist/{chunk-DJ4PSDQS.mjs → chunk-FYINJRYN.mjs} +2 -2
- package/dist/{chunk-KFPQ6DIH.mjs → chunk-GV4F6X3C.mjs} +29 -25
- package/dist/chunk-HKAZXG74.mjs +308 -0
- package/dist/{chunk-QWUDJC6K.mjs → chunk-HOYBHB7B.mjs} +38 -17
- package/dist/{chunk-IZYFETUS.mjs → chunk-HS6KUPTI.mjs} +2 -2
- package/dist/{chunk-EKESN747.mjs → chunk-HSBN5MLS.mjs} +1 -1
- package/dist/{chunk-AJJJ6HWC.mjs → chunk-K4GIKSZE.mjs} +1 -1
- package/dist/{chunk-2UOGBS3C.mjs → chunk-KP6DEYWB.mjs} +27 -6
- package/dist/{chunk-PAN256RW.mjs → chunk-KVCI2346.mjs} +59 -55
- package/dist/{chunk-3O2WHF3U.mjs → chunk-NCHUEGUW.mjs} +2 -2
- package/dist/{chunk-VD55SSP7.mjs → chunk-PD6Q36OO.mjs} +14 -6
- package/dist/{chunk-5RVLBNLI.mjs → chunk-RJPNBYK5.mjs} +4 -4
- package/dist/{chunk-HXD7KMRP.mjs → chunk-UCBW5RJN.mjs} +31 -2
- package/dist/{chunk-5IHOOP5A.mjs → chunk-UD4DTVJZ.mjs} +64 -79
- package/dist/{chunk-A6JNS35U.mjs → chunk-UT5BV2VO.mjs} +2 -2
- package/dist/{chunk-K6GJMKJR.mjs → chunk-V6P7ZK6O.mjs} +3 -3
- package/dist/{chunk-4XGO3OSE.mjs → chunk-XE4YFBOZ.mjs} +12 -17
- package/dist/{chunk-YI7NQWUV.mjs → chunk-YI6YWH66.mjs} +14 -30
- package/dist/{chunk-SHCBCM2W.mjs → chunk-YIB6ZXZF.mjs} +142 -105
- package/dist/{chunk-SZBYEGKU.mjs → chunk-ZCGIZOMT.mjs} +1 -1
- package/dist/{chunk-S7IB6YST.mjs → chunk-ZG56T75O.mjs} +25 -40
- package/dist/{chunk-44BPUG24.mjs → chunk-ZH5ZBLAN.mjs} +38 -16
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/AreaChart.mjs +1 -1
- package/dist/components/AutoComplete.mjs +2 -1
- package/dist/components/BarChart.mjs +1 -1
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ColorPicker.mjs +2 -1
- package/dist/components/CommentThread.mjs +1 -1
- package/dist/components/CropUpload.mjs +4 -4
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +6 -6
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FormItem.mjs +2 -1
- package/dist/components/Image.mjs +5 -5
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/ImageGroup.mjs +3 -3
- package/dist/components/ImagePreview.mjs +2 -2
- package/dist/components/LineChart.mjs +1 -1
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -1
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +3 -3
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/ScatterChart.mjs +1 -1
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/Table.mjs +3 -2
- package/dist/components/TimePicker.mjs +2 -1
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.mjs +1 -1
- package/dist/components/VirtualTable.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
- package/dist/chunk-KVARQQAG.mjs +0 -181
- package/dist/chunk-SEWNVIHH.mjs +0 -153
- package/dist/chunk-XIVU7TWX.mjs +0 -305
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KVCI2346.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Radio
|
|
6
6
|
} from "./chunk-IIWUQK2P.mjs";
|
|
@@ -1202,6 +1202,7 @@ function Table({
|
|
|
1202
1202
|
[autoVirtual, dataSource.length, virtual, virtualThreshold]
|
|
1203
1203
|
);
|
|
1204
1204
|
const effectiveVirtual = virtualRecommendation.enabled;
|
|
1205
|
+
const shouldObserveGeometry = effectiveVirtual || columnLockable || ctx.displayColumns.some((column) => column.fixed === "left" || column.fixed === "right");
|
|
1205
1206
|
const [virtualScrollTop, setVirtualScrollTop] = useState2(0);
|
|
1206
1207
|
const virtualWindow = useMemo2(
|
|
1207
1208
|
() => effectiveVirtual ? getTableVirtualWindow(
|
|
@@ -1224,6 +1225,9 @@ function Table({
|
|
|
1224
1225
|
} : void 0;
|
|
1225
1226
|
}, [effectiveVirtual, maxHeight, virtualHeight]);
|
|
1226
1227
|
useEffect2(() => {
|
|
1228
|
+
if (!shouldObserveGeometry) {
|
|
1229
|
+
return void 0;
|
|
1230
|
+
}
|
|
1227
1231
|
const wrapper = wrapperRef.current;
|
|
1228
1232
|
if (!wrapper) {
|
|
1229
1233
|
return void 0;
|
|
@@ -1240,7 +1244,7 @@ function Table({
|
|
|
1240
1244
|
});
|
|
1241
1245
|
controller.observe(wrapper, tableRef.current);
|
|
1242
1246
|
return () => controller.disconnect();
|
|
1243
|
-
}, [ctx.displayColumns.length, ctx.paginatedData.length]);
|
|
1247
|
+
}, [shouldObserveGeometry, ctx.displayColumns.length, ctx.paginatedData.length]);
|
|
1244
1248
|
return /* @__PURE__ */ jsxs4(
|
|
1245
1249
|
"div",
|
|
1246
1250
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
2
|
+
renderOverlayPortal,
|
|
3
|
+
useAnchoredOverlay
|
|
4
|
+
} from "./chunk-HKAZXG74.mjs";
|
|
5
5
|
|
|
6
6
|
// src/components/Menu.tsx
|
|
7
7
|
import React5 from "react";
|
|
@@ -268,8 +268,6 @@ import React4, { useState as useState2, useMemo as useMemo2, useCallback as useC
|
|
|
268
268
|
import {
|
|
269
269
|
classNames as classNames3,
|
|
270
270
|
getSubMenuTitleClasses,
|
|
271
|
-
getSubmenuPopupZIndex,
|
|
272
|
-
getTransformOrigin,
|
|
273
271
|
getMenuItemIndent as getMenuItemIndent2,
|
|
274
272
|
isKeyOpen,
|
|
275
273
|
menuItemIconClasses as menuItemIconClasses2,
|
|
@@ -367,16 +365,18 @@ var SubMenu = ({
|
|
|
367
365
|
const isExpanded = isPopup ? isHovered || isOpenByKeyboard : isOpen;
|
|
368
366
|
const popupPortal = Boolean(isPopup && menuContext?.popupPortal);
|
|
369
367
|
const popupPlacement = menuContext?.mode === "horizontal" && level === 0 ? "bottom-start" : "right-start";
|
|
370
|
-
const {
|
|
371
|
-
x: popupX,
|
|
372
|
-
y: popupY,
|
|
373
|
-
placement: currentPopupPlacement
|
|
374
|
-
} = useFloating({
|
|
368
|
+
const overlay = useAnchoredOverlay({
|
|
375
369
|
referenceRef: titleRef,
|
|
376
370
|
floatingRef: popupRef,
|
|
377
|
-
enabled:
|
|
371
|
+
enabled: isPopup && isExpanded,
|
|
378
372
|
placement: popupPlacement,
|
|
379
|
-
offset: 4
|
|
373
|
+
offset: 4,
|
|
374
|
+
portal: popupPortal,
|
|
375
|
+
dismissOnEscape: true,
|
|
376
|
+
onDismiss: () => {
|
|
377
|
+
setIsOpenByKeyboard(false);
|
|
378
|
+
setIsHovered(false);
|
|
379
|
+
}
|
|
380
380
|
});
|
|
381
381
|
const isInlineOrVertical = menuContext?.mode !== "horizontal" && !isPopup;
|
|
382
382
|
const [hasRenderedInline, setHasRenderedInline] = useState2(
|
|
@@ -572,22 +572,14 @@ var SubMenu = ({
|
|
|
572
572
|
}
|
|
573
573
|
return child;
|
|
574
574
|
});
|
|
575
|
-
const popupZIndex = isPopup ? getSubmenuPopupZIndex(level) : {};
|
|
576
575
|
if (isPopup) {
|
|
577
|
-
const popupStyle = popupPortal ? {
|
|
578
|
-
display: isExpanded ? "block" : "none",
|
|
579
|
-
position: "absolute",
|
|
580
|
-
left: popupX,
|
|
581
|
-
top: popupY,
|
|
582
|
-
transformOrigin: getTransformOrigin(currentPopupPlacement),
|
|
583
|
-
...popupZIndex
|
|
584
|
-
} : { display: isExpanded ? "block" : "none", ...popupZIndex };
|
|
585
576
|
const popup = /* @__PURE__ */ jsx4(
|
|
586
577
|
"ul",
|
|
587
578
|
{
|
|
588
|
-
ref:
|
|
589
|
-
className: contentClasses,
|
|
590
|
-
style:
|
|
579
|
+
ref: popupRef,
|
|
580
|
+
className: classNames3(contentClasses, overlay.floatingClasses),
|
|
581
|
+
style: { ...overlay.floatingStyles, display: isExpanded ? "block" : "none" },
|
|
582
|
+
"data-positioned": overlay.positioned,
|
|
591
583
|
role: "menu",
|
|
592
584
|
"aria-hidden": isExpanded ? void 0 : "true",
|
|
593
585
|
onMouseEnter: popupPortal ? handleMouseEnter : void 0,
|
|
@@ -596,20 +588,7 @@ var SubMenu = ({
|
|
|
596
588
|
children: enhancedChildren
|
|
597
589
|
}
|
|
598
590
|
);
|
|
599
|
-
|
|
600
|
-
return renderBodyPortal(popup);
|
|
601
|
-
}
|
|
602
|
-
return /* @__PURE__ */ jsx4(
|
|
603
|
-
"ul",
|
|
604
|
-
{
|
|
605
|
-
className: contentClasses,
|
|
606
|
-
style: { display: isExpanded ? "block" : "none", ...popupZIndex },
|
|
607
|
-
role: "menu",
|
|
608
|
-
"aria-hidden": isExpanded ? void 0 : "true",
|
|
609
|
-
"data-tiger-submenu-popup": "",
|
|
610
|
-
children: enhancedChildren
|
|
611
|
-
}
|
|
612
|
-
);
|
|
591
|
+
return renderOverlayPortal(popup, overlay.target, !popupPortal);
|
|
613
592
|
}
|
|
614
593
|
if (!hasRenderedInline) return null;
|
|
615
594
|
const isHidden = !isExpanded;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useBodyScrollLock,
|
|
4
4
|
useEscapeKey,
|
|
5
5
|
useFocusTrap
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HKAZXG74.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useTigerConfig
|
|
9
9
|
} from "./chunk-YSIXURBW.mjs";
|
|
@@ -117,7 +117,6 @@ var Drawer = ({
|
|
|
117
117
|
},
|
|
118
118
|
[maskClosable, handleClose]
|
|
119
119
|
);
|
|
120
|
-
useEscapeKey({ enabled: open, onEscape: handleClose });
|
|
121
120
|
useBodyScrollLock({ enabled: open });
|
|
122
121
|
const previousVisible = useRef(false);
|
|
123
122
|
useEffect(() => {
|
|
@@ -138,6 +137,7 @@ var Drawer = ({
|
|
|
138
137
|
const reactId = useId();
|
|
139
138
|
const drawerId = useMemo(() => `tiger-drawer-${reactId}`, [reactId]);
|
|
140
139
|
const titleId = `${drawerId}-title`;
|
|
140
|
+
const overlayHostId = `${drawerId}-overlay-host`;
|
|
141
141
|
const {
|
|
142
142
|
["aria-labelledby"]: _ariaLabelledby,
|
|
143
143
|
role: _role,
|
|
@@ -146,10 +146,12 @@ var Drawer = ({
|
|
|
146
146
|
} = rest;
|
|
147
147
|
const ariaLabelledby = rest["aria-labelledby"] ?? (title || header ? titleId : void 0);
|
|
148
148
|
const dialogRef = useRef(null);
|
|
149
|
+
const rootRef = useRef(null);
|
|
149
150
|
const closeButtonRef = useRef(null);
|
|
150
151
|
const previousActiveElementRef = useRef(null);
|
|
151
152
|
const touchStartRef = useRef(null);
|
|
152
153
|
const touchCurrentRef = useRef(null);
|
|
154
|
+
useEscapeKey({ enabled: open, onEscape: handleClose, layerRef: rootRef });
|
|
153
155
|
const resolvedCloseAriaLabel = resolveLocaleText(
|
|
154
156
|
"Close drawer",
|
|
155
157
|
closeAriaLabel,
|
|
@@ -167,7 +169,7 @@ var Drawer = ({
|
|
|
167
169
|
}
|
|
168
170
|
restoreFocus(previousActiveElementRef.current);
|
|
169
171
|
}, [open]);
|
|
170
|
-
useFocusTrap({ enabled: open, containerRef:
|
|
172
|
+
useFocusTrap({ enabled: open, containerRef: rootRef });
|
|
171
173
|
const resetTouchGesture = useCallback(() => {
|
|
172
174
|
touchStartRef.current = null;
|
|
173
175
|
touchCurrentRef.current = null;
|
|
@@ -235,10 +237,12 @@ var Drawer = ({
|
|
|
235
237
|
const drawerContent = /* @__PURE__ */ jsxs(
|
|
236
238
|
"div",
|
|
237
239
|
{
|
|
240
|
+
ref: rootRef,
|
|
238
241
|
className: containerClasses,
|
|
239
242
|
style: { zIndex },
|
|
240
243
|
hidden: !open && !isClosingBeforeDestroy,
|
|
241
244
|
"aria-hidden": !open ? "true" : void 0,
|
|
245
|
+
"data-tiger-overlay-layer": "",
|
|
242
246
|
"data-tiger-drawer-root": "",
|
|
243
247
|
children: [
|
|
244
248
|
mask && /* @__PURE__ */ jsx(
|
|
@@ -265,6 +269,7 @@ var Drawer = ({
|
|
|
265
269
|
role: "dialog",
|
|
266
270
|
"aria-modal": "true",
|
|
267
271
|
"aria-labelledby": ariaLabelledby,
|
|
272
|
+
"aria-owns": overlayHostId,
|
|
268
273
|
tabIndex: -1,
|
|
269
274
|
ref: dialogRef,
|
|
270
275
|
onTouchStart: handleTouchStart,
|
|
@@ -291,7 +296,8 @@ var Drawer = ({
|
|
|
291
296
|
footer && /* @__PURE__ */ jsx("div", { className: footerClasses, children: footer })
|
|
292
297
|
]
|
|
293
298
|
}
|
|
294
|
-
)
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx("div", { id: overlayHostId, className: "contents", "data-tiger-overlay-host": "" })
|
|
295
301
|
]
|
|
296
302
|
}
|
|
297
303
|
);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useControlledState
|
|
3
3
|
} from "./chunk-MEFARVQI.mjs";
|
|
4
|
+
import {
|
|
5
|
+
renderOverlayPortal,
|
|
6
|
+
useAnchoredOverlay
|
|
7
|
+
} from "./chunk-HKAZXG74.mjs";
|
|
4
8
|
import {
|
|
5
9
|
useTigerConfig
|
|
6
10
|
} from "./chunk-YSIXURBW.mjs";
|
|
@@ -106,6 +110,7 @@ function useDatePickerState(props) {
|
|
|
106
110
|
);
|
|
107
111
|
const calendarRef = useRef(null);
|
|
108
112
|
const mobileCalendarRef = useRef(null);
|
|
113
|
+
const panelRef = useRef(null);
|
|
109
114
|
const inputWrapperRef = useRef(null);
|
|
110
115
|
const inputRef = useRef(null);
|
|
111
116
|
const pendingFocusIsoRef = useRef(null);
|
|
@@ -390,12 +395,6 @@ function useDatePickerState(props) {
|
|
|
390
395
|
};
|
|
391
396
|
useEffect(() => {
|
|
392
397
|
if (isOpen) {
|
|
393
|
-
const handleClickOutside = (event) => {
|
|
394
|
-
if (calendarRef.current && mobileCalendarRef.current && inputWrapperRef.current && !calendarRef.current.contains(event.target) && !mobileCalendarRef.current.contains(event.target) && !inputWrapperRef.current.contains(event.target)) {
|
|
395
|
-
closeCalendar();
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
document.addEventListener("click", handleClickOutside);
|
|
399
398
|
const preferred = pendingFocusIsoRef.current ?? getPreferredFocusIso();
|
|
400
399
|
pendingFocusIsoRef.current = null;
|
|
401
400
|
setTimeout(() => {
|
|
@@ -403,7 +402,7 @@ function useDatePickerState(props) {
|
|
|
403
402
|
const fallback = getFirstEnabledIsoInView();
|
|
404
403
|
if (fallback) focusDateButtonByIso(fallback);
|
|
405
404
|
}, 0);
|
|
406
|
-
return
|
|
405
|
+
return;
|
|
407
406
|
}
|
|
408
407
|
setTimeout(() => restoreFocus(), 0);
|
|
409
408
|
}, [
|
|
@@ -433,6 +432,7 @@ function useDatePickerState(props) {
|
|
|
433
432
|
return {
|
|
434
433
|
inputWrapperRef,
|
|
435
434
|
inputRef,
|
|
435
|
+
panelRef,
|
|
436
436
|
calendarRef,
|
|
437
437
|
mobileCalendarRef,
|
|
438
438
|
isOpen,
|
|
@@ -726,6 +726,17 @@ function renderDatePickerCalendar(ctx) {
|
|
|
726
726
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
727
727
|
var DatePicker = (props) => {
|
|
728
728
|
const ctx = useDatePickerState(props);
|
|
729
|
+
const overlay = useAnchoredOverlay({
|
|
730
|
+
enabled: ctx.isOpen,
|
|
731
|
+
referenceRef: ctx.inputWrapperRef,
|
|
732
|
+
floatingRef: ctx.panelRef,
|
|
733
|
+
placement: "bottom-start",
|
|
734
|
+
offset: 4,
|
|
735
|
+
layout: "bottom-sheet-sm",
|
|
736
|
+
dismissOnOutside: true,
|
|
737
|
+
dismissOnEscape: true,
|
|
738
|
+
onDismiss: ctx.closeCalendar
|
|
739
|
+
});
|
|
729
740
|
return /* @__PURE__ */ jsxs3("div", { className: ctx.containerClasses, ...ctx.divProps, children: [
|
|
730
741
|
/* @__PURE__ */ jsxs3("div", { ref: ctx.inputWrapperRef, className: datePickerInputWrapperClasses, children: [
|
|
731
742
|
/* @__PURE__ */ jsx4(
|
|
@@ -767,8 +778,22 @@ var DatePicker = (props) => {
|
|
|
767
778
|
}
|
|
768
779
|
)
|
|
769
780
|
] }),
|
|
770
|
-
|
|
771
|
-
|
|
781
|
+
renderOverlayPortal(
|
|
782
|
+
ctx.isOpen ? /* @__PURE__ */ jsxs3(
|
|
783
|
+
"div",
|
|
784
|
+
{
|
|
785
|
+
ref: ctx.panelRef,
|
|
786
|
+
className: overlay.floatingClasses,
|
|
787
|
+
style: overlay.floatingStyles,
|
|
788
|
+
"data-positioned": overlay.positioned,
|
|
789
|
+
children: [
|
|
790
|
+
renderDatePickerMobile(ctx),
|
|
791
|
+
renderDatePickerCalendar(ctx)
|
|
792
|
+
]
|
|
793
|
+
}
|
|
794
|
+
) : null,
|
|
795
|
+
overlay.target
|
|
796
|
+
)
|
|
772
797
|
] });
|
|
773
798
|
};
|
|
774
799
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImageGroupContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HSBN5MLS.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ImagePreview
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZCGIZOMT.mjs";
|
|
7
7
|
import {
|
|
8
8
|
usePopup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZG56T75O.mjs";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
renderOverlayPortal
|
|
12
|
+
} from "./chunk-HKAZXG74.mjs";
|
|
13
13
|
|
|
14
14
|
// src/components/Image.tsx
|
|
15
15
|
import { useState, useRef, useEffect, useMemo, useContext, useCallback } from "react";
|
|
@@ -68,6 +68,9 @@ var Image = ({
|
|
|
68
68
|
triggerRef: hoverTriggerRef,
|
|
69
69
|
floatingRef: hoverFloatingRef,
|
|
70
70
|
floatingStyles: hoverFloatingStyles,
|
|
71
|
+
floatingClasses: hoverFloatingClasses,
|
|
72
|
+
positioned: hoverPositioned,
|
|
73
|
+
overlayTarget: hoverOverlayTarget,
|
|
71
74
|
triggerHandlers: hoverTriggerHandlers
|
|
72
75
|
} = usePopup({
|
|
73
76
|
trigger: "hover",
|
|
@@ -206,17 +209,22 @@ var Image = ({
|
|
|
206
209
|
}
|
|
207
210
|
}
|
|
208
211
|
),
|
|
209
|
-
hoverPreviewEnabled && hoverVisible && src &&
|
|
212
|
+
hoverPreviewEnabled && hoverVisible && src && renderOverlayPortal(
|
|
210
213
|
/* @__PURE__ */ jsx(
|
|
211
214
|
"div",
|
|
212
215
|
{
|
|
213
216
|
ref: hoverFloatingRef,
|
|
214
217
|
style: hoverFloatingStyles,
|
|
218
|
+
className: classNames(
|
|
219
|
+
hoverFloatingClasses,
|
|
220
|
+
"rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] p-1 shadow-lg"
|
|
221
|
+
),
|
|
222
|
+
"data-positioned": hoverPositioned,
|
|
215
223
|
"aria-hidden": true,
|
|
216
|
-
className: "rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] p-1 shadow-lg",
|
|
217
224
|
children: /* @__PURE__ */ jsx("img", { src, alt: "", className: "block max-w-[16rem] max-h-[16rem] object-contain" })
|
|
218
225
|
}
|
|
219
|
-
)
|
|
226
|
+
),
|
|
227
|
+
hoverOverlayTarget
|
|
220
228
|
)
|
|
221
229
|
] });
|
|
222
230
|
};
|
|
@@ -353,12 +353,12 @@ var ScatterChart = ({
|
|
|
353
353
|
}
|
|
354
354
|
);
|
|
355
355
|
if (!showLegend) {
|
|
356
|
-
return /* @__PURE__ */ jsxs("div", { className: "inline-block
|
|
356
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames("relative", responsive ? "block w-full min-w-0" : "inline-block"), children: [
|
|
357
357
|
chart,
|
|
358
358
|
tooltip
|
|
359
359
|
] });
|
|
360
360
|
}
|
|
361
|
-
return /* @__PURE__ */ jsxs("div", { className: wrapperClasses, children: [
|
|
361
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames(wrapperClasses, responsive && "w-full min-w-0"), children: [
|
|
362
362
|
chart,
|
|
363
363
|
/* @__PURE__ */ jsx(
|
|
364
364
|
ChartLegend,
|
|
@@ -566,12 +566,12 @@ var AreaChart = ({
|
|
|
566
566
|
}
|
|
567
567
|
);
|
|
568
568
|
if (!showLegend) {
|
|
569
|
-
return /* @__PURE__ */ jsxs("div", { className: "inline-block
|
|
569
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames("relative", responsive ? "block w-full min-w-0" : "inline-block"), children: [
|
|
570
570
|
chart,
|
|
571
571
|
tooltip
|
|
572
572
|
] });
|
|
573
573
|
}
|
|
574
|
-
return /* @__PURE__ */ jsxs("div", { className: wrapperClasses, children: [
|
|
574
|
+
return /* @__PURE__ */ jsxs("div", { className: classNames(wrapperClasses, responsive && "w-full min-w-0"), children: [
|
|
575
575
|
chart,
|
|
576
576
|
/* @__PURE__ */ jsx(
|
|
577
577
|
ChartLegend,
|
|
@@ -178,7 +178,7 @@ var VirtualTable = ({
|
|
|
178
178
|
})
|
|
179
179
|
),
|
|
180
180
|
style: { ...widthStyle, ...stickyStyle },
|
|
181
|
-
children: col.title ?? ""
|
|
181
|
+
children: col.renderHeader ? col.renderHeader() : col.title ?? ""
|
|
182
182
|
},
|
|
183
183
|
col.key
|
|
184
184
|
);
|
|
@@ -215,30 +215,34 @@ var VirtualTable = ({
|
|
|
215
215
|
} : void 0,
|
|
216
216
|
children: [
|
|
217
217
|
colRange && colRange.leftPad > 0 && /* @__PURE__ */ jsx("td", { "aria-hidden": true, style: { width: `${colRange.leftPad}px`, padding: 0 } }),
|
|
218
|
-
visibleColumns.map((col, colIdx) =>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
218
|
+
visibleColumns.map((col, colIdx) => {
|
|
219
|
+
const dataKey = col.dataKey || col.key;
|
|
220
|
+
const value = row[dataKey];
|
|
221
|
+
return /* @__PURE__ */ jsx(
|
|
222
|
+
"td",
|
|
223
|
+
{
|
|
224
|
+
"aria-colindex": colIndexOffset + colIdx + 1,
|
|
225
|
+
className: classNames(
|
|
226
|
+
virtualTableCellClasses,
|
|
227
|
+
getTableFixedCellClasses({
|
|
228
|
+
view: "virtual-table",
|
|
229
|
+
column: col,
|
|
230
|
+
record: row,
|
|
231
|
+
rowIndex: globalIdx,
|
|
232
|
+
striped,
|
|
233
|
+
stripedActive: striped && globalIdx % 2 === 1,
|
|
234
|
+
selected: isSelected,
|
|
235
|
+
hoverable: true,
|
|
236
|
+
fixedInfo,
|
|
237
|
+
selectedClassName: virtualTableFixedCellSelectedClasses
|
|
238
|
+
})
|
|
239
|
+
),
|
|
240
|
+
style: getVirtualTableFixedCellStyle(col.key, fixedInfo),
|
|
241
|
+
children: renderCell ? renderCell(value, row, col) : col.render ? col.render(row, globalIdx) : value
|
|
242
|
+
},
|
|
243
|
+
col.key
|
|
244
|
+
);
|
|
245
|
+
}),
|
|
242
246
|
colRange && colRange.rightPad > 0 && /* @__PURE__ */ jsx("td", { "aria-hidden": true, style: { width: `${colRange.rightPad}px`, padding: 0 } })
|
|
243
247
|
]
|
|
244
248
|
},
|