@octaviaflow/core 3.0.18-beta.47 → 3.0.18-beta.49
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/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/index.cjs +29 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -15
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/useAnchoredPopover.d.ts +3 -0
- package/dist/utils/useAnchoredPopover.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11885,8 +11885,10 @@ import { createPortal as createPortal9 } from "react-dom";
|
|
|
11885
11885
|
import {
|
|
11886
11886
|
useCallback as useCallback19,
|
|
11887
11887
|
useEffect as useEffect17,
|
|
11888
|
+
useLayoutEffect as useLayoutEffect6,
|
|
11888
11889
|
useState as useState21
|
|
11889
11890
|
} from "react";
|
|
11891
|
+
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? useLayoutEffect6 : useEffect17;
|
|
11890
11892
|
function computeAnchoredPosition({
|
|
11891
11893
|
anchor,
|
|
11892
11894
|
viewport,
|
|
@@ -11898,8 +11900,17 @@ function computeAnchoredPosition({
|
|
|
11898
11900
|
const spaceBelow = viewport.height - anchor.bottom - gap - margin;
|
|
11899
11901
|
const spaceAbove = anchor.top - gap - margin;
|
|
11900
11902
|
const openUp = spaceBelow < preferredMinHeight && spaceAbove > spaceBelow;
|
|
11901
|
-
const
|
|
11902
|
-
const
|
|
11903
|
+
const maxHeight = Math.max(0, openUp ? spaceAbove : spaceBelow);
|
|
11904
|
+
const measured = popoverWidth && popoverWidth > 0 ? popoverWidth : 0;
|
|
11905
|
+
const renderW = Math.max(measured, anchor.width);
|
|
11906
|
+
const maxAvailW = viewport.width - 2 * margin;
|
|
11907
|
+
let effectiveW = renderW;
|
|
11908
|
+
let maxWidth;
|
|
11909
|
+
if (renderW > maxAvailW) {
|
|
11910
|
+
effectiveW = maxAvailW;
|
|
11911
|
+
maxWidth = maxAvailW;
|
|
11912
|
+
}
|
|
11913
|
+
const maxLeft = viewport.width - effectiveW - margin;
|
|
11903
11914
|
let left = anchor.left;
|
|
11904
11915
|
if (left > maxLeft) left = maxLeft;
|
|
11905
11916
|
if (left < margin) left = margin;
|
|
@@ -11907,7 +11918,8 @@ function computeAnchoredPosition({
|
|
|
11907
11918
|
...openUp ? { bottom: viewport.height - anchor.top + gap } : { top: anchor.bottom + gap },
|
|
11908
11919
|
left,
|
|
11909
11920
|
width: anchor.width,
|
|
11910
|
-
|
|
11921
|
+
...maxWidth !== void 0 ? { maxWidth } : {},
|
|
11922
|
+
maxHeight,
|
|
11911
11923
|
direction: openUp ? "up" : "down"
|
|
11912
11924
|
};
|
|
11913
11925
|
}
|
|
@@ -11941,7 +11953,7 @@ function useAnchoredPopover(anchorRef, open, options = {}) {
|
|
|
11941
11953
|
})
|
|
11942
11954
|
);
|
|
11943
11955
|
}, [anchorRef, popoverRef, gap, margin, preferredMinHeight]);
|
|
11944
|
-
|
|
11956
|
+
useIsomorphicLayoutEffect(() => {
|
|
11945
11957
|
if (!open) return;
|
|
11946
11958
|
update();
|
|
11947
11959
|
window.addEventListener("scroll", update, true);
|
|
@@ -11960,6 +11972,7 @@ function anchoredPopoverStyle(pos, extra) {
|
|
|
11960
11972
|
...pos.bottom !== void 0 ? { bottom: pos.bottom } : {},
|
|
11961
11973
|
left: pos.left,
|
|
11962
11974
|
minWidth: pos.width,
|
|
11975
|
+
...pos.maxWidth !== void 0 ? { maxWidth: pos.maxWidth } : {},
|
|
11963
11976
|
maxHeight: pos.maxHeight,
|
|
11964
11977
|
...extra
|
|
11965
11978
|
};
|
|
@@ -15944,7 +15957,7 @@ var Heatmap = forwardRef48(
|
|
|
15944
15957
|
Heatmap.displayName = "Heatmap";
|
|
15945
15958
|
|
|
15946
15959
|
// src/components/HoverCard/HoverCard.tsx
|
|
15947
|
-
import { useCallback as useCallback25, useEffect as useEffect25, useLayoutEffect as
|
|
15960
|
+
import { useCallback as useCallback25, useEffect as useEffect25, useLayoutEffect as useLayoutEffect7, useRef as useRef29, useState as useState30 } from "react";
|
|
15948
15961
|
import { createPortal as createPortal11 } from "react-dom";
|
|
15949
15962
|
import { Fragment as Fragment25, jsx as jsx59, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
15950
15963
|
function computePosition3(rect, panelRect, placement, offset) {
|
|
@@ -16001,7 +16014,7 @@ function HoverCard({
|
|
|
16001
16014
|
const panelRect = panelRef.current.getBoundingClientRect();
|
|
16002
16015
|
setCoords(computePosition3(trigRect, panelRect, placement, offset));
|
|
16003
16016
|
}, [placement, offset]);
|
|
16004
|
-
|
|
16017
|
+
useLayoutEffect7(() => {
|
|
16005
16018
|
if (!open) return;
|
|
16006
16019
|
reposition();
|
|
16007
16020
|
const id = requestAnimationFrame(reposition);
|
|
@@ -18262,7 +18275,7 @@ import {
|
|
|
18262
18275
|
useCallback as useCallback27,
|
|
18263
18276
|
useEffect as useEffect29,
|
|
18264
18277
|
useId as useId35,
|
|
18265
|
-
useLayoutEffect as
|
|
18278
|
+
useLayoutEffect as useLayoutEffect8,
|
|
18266
18279
|
useMemo as useMemo22,
|
|
18267
18280
|
useRef as useRef33,
|
|
18268
18281
|
useState as useState34
|
|
@@ -18389,7 +18402,7 @@ var MultiSelect = forwardRef60(
|
|
|
18389
18402
|
useEffect29(() => setActiveIdx(0), [query, open]);
|
|
18390
18403
|
const [fitCount, setFitCount] = useState34(selectedValues.length);
|
|
18391
18404
|
const [tick, setTick] = useState34(0);
|
|
18392
|
-
|
|
18405
|
+
useLayoutEffect8(() => {
|
|
18393
18406
|
if (maxVisibleTags !== void 0) {
|
|
18394
18407
|
setFitCount(Math.min(selectedValues.length, maxVisibleTags));
|
|
18395
18408
|
return;
|
|
@@ -20647,7 +20660,7 @@ var PipelineCard = forwardRef66(
|
|
|
20647
20660
|
PipelineCard.displayName = "PipelineCard";
|
|
20648
20661
|
|
|
20649
20662
|
// src/components/Popover/Popover.tsx
|
|
20650
|
-
import { useCallback as useCallback32, useEffect as useEffect31, useLayoutEffect as
|
|
20663
|
+
import { useCallback as useCallback32, useEffect as useEffect31, useLayoutEffect as useLayoutEffect9, useRef as useRef36, useState as useState38 } from "react";
|
|
20651
20664
|
import { createPortal as createPortal13 } from "react-dom";
|
|
20652
20665
|
import { Fragment as Fragment34, jsx as jsx78, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
20653
20666
|
function computePosition4(rect, popRect, placement, offset) {
|
|
@@ -20697,7 +20710,7 @@ function Popover({
|
|
|
20697
20710
|
const popRect = popRef.current.getBoundingClientRect();
|
|
20698
20711
|
setCoords(computePosition4(trigRect, popRect, placement, offset));
|
|
20699
20712
|
}, [placement, offset]);
|
|
20700
|
-
|
|
20713
|
+
useLayoutEffect9(() => {
|
|
20701
20714
|
if (!open) return;
|
|
20702
20715
|
reposition();
|
|
20703
20716
|
const id = requestAnimationFrame(reposition);
|
|
@@ -22329,7 +22342,7 @@ import {
|
|
|
22329
22342
|
forwardRef as forwardRef78,
|
|
22330
22343
|
useCallback as useCallback34,
|
|
22331
22344
|
useEffect as useEffect33,
|
|
22332
|
-
useLayoutEffect as
|
|
22345
|
+
useLayoutEffect as useLayoutEffect10,
|
|
22333
22346
|
useRef as useRef40,
|
|
22334
22347
|
useState as useState41
|
|
22335
22348
|
} from "react";
|
|
@@ -22373,7 +22386,7 @@ var Resizable = forwardRef78(
|
|
|
22373
22386
|
if (typeof ref === "function") ref(node);
|
|
22374
22387
|
else if (ref) ref.current = node;
|
|
22375
22388
|
};
|
|
22376
|
-
|
|
22389
|
+
useLayoutEffect10(() => {
|
|
22377
22390
|
const el = wrapRef.current;
|
|
22378
22391
|
if (!el) return;
|
|
22379
22392
|
const t = direction === "horizontal" ? el.offsetWidth : el.offsetHeight;
|
|
@@ -24193,7 +24206,7 @@ import {
|
|
|
24193
24206
|
forwardRef as forwardRef86,
|
|
24194
24207
|
useCallback as useCallback37,
|
|
24195
24208
|
useEffect as useEffect37,
|
|
24196
|
-
useLayoutEffect as
|
|
24209
|
+
useLayoutEffect as useLayoutEffect11,
|
|
24197
24210
|
useMemo as useMemo25,
|
|
24198
24211
|
useState as useState44
|
|
24199
24212
|
} from "react";
|
|
@@ -24235,7 +24248,7 @@ var Spotlight = forwardRef86(
|
|
|
24235
24248
|
height: window.innerHeight
|
|
24236
24249
|
});
|
|
24237
24250
|
}, [open, target]);
|
|
24238
|
-
|
|
24251
|
+
useLayoutEffect11(() => {
|
|
24239
24252
|
measure();
|
|
24240
24253
|
}, [measure]);
|
|
24241
24254
|
useEffect37(() => {
|
|
@@ -27232,8 +27245,20 @@ var TimePicker = forwardRef98(
|
|
|
27232
27245
|
setActiveSeg(null);
|
|
27233
27246
|
}
|
|
27234
27247
|
};
|
|
27248
|
+
const onKey = (e) => {
|
|
27249
|
+
if (e.key === "Escape") {
|
|
27250
|
+
flushDraft();
|
|
27251
|
+
setOpen(false);
|
|
27252
|
+
setActiveSeg(null);
|
|
27253
|
+
triggerRef.current?.focus();
|
|
27254
|
+
}
|
|
27255
|
+
};
|
|
27235
27256
|
document.addEventListener("mousedown", onDoc);
|
|
27236
|
-
|
|
27257
|
+
document.addEventListener("keydown", onKey);
|
|
27258
|
+
return () => {
|
|
27259
|
+
document.removeEventListener("mousedown", onDoc);
|
|
27260
|
+
document.removeEventListener("keydown", onKey);
|
|
27261
|
+
};
|
|
27237
27262
|
}, [open, flushDraft]);
|
|
27238
27263
|
const segOrder = () => showSeconds ? ["hours", "minutes", "seconds"] : ["hours", "minutes"];
|
|
27239
27264
|
const handleSegKey = (seg) => (e) => {
|