@x-plat/design-system 0.14.18 → 0.15.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.
- package/dist/components/Dropdown/index.cjs +54 -17
- package/dist/components/Dropdown/index.js +54 -17
- package/dist/components/PopOver/index.cjs +53 -16
- package/dist/components/PopOver/index.js +53 -16
- package/dist/components/Select/index.cjs +73 -36
- package/dist/components/Select/index.js +73 -36
- package/dist/components/TimePicker/index.cjs +58 -21
- package/dist/components/TimePicker/index.js +58 -21
- package/dist/components/Tooltip/index.cjs +2 -2
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/index.cjs +255 -215
- package/dist/components/index.js +255 -215
- package/dist/index.cjs +260 -220
- package/dist/index.js +260 -220
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -3188,10 +3188,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3188
3188
|
const scrollParentRef = React10.useRef(null);
|
|
3189
3189
|
const placedRef = React10.useRef(false);
|
|
3190
3190
|
const frozenMaxRef = React10.useRef(void 0);
|
|
3191
|
+
const cssCapRef = React10.useRef(void 0);
|
|
3191
3192
|
const calculatePosition = React10.useCallback((remeasure = false) => {
|
|
3192
3193
|
const pop = popRef.current;
|
|
3193
3194
|
if (!triggerRef.current || !pop) return;
|
|
3194
3195
|
if (remeasure) frozenMaxRef.current = void 0;
|
|
3196
|
+
if (cssCapRef.current === void 0) {
|
|
3197
|
+
pop.style.maxHeight = "";
|
|
3198
|
+
const raw = getComputedStyle(pop).maxHeight;
|
|
3199
|
+
cssCapRef.current = raw === "none" ? null : Number.parseFloat(raw) || null;
|
|
3200
|
+
}
|
|
3195
3201
|
if (remeasure || !sizeRef.current) {
|
|
3196
3202
|
sizeRef.current = {
|
|
3197
3203
|
w: pop.offsetWidth,
|
|
@@ -3213,8 +3219,10 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3213
3219
|
};
|
|
3214
3220
|
const first = !placedRef.current;
|
|
3215
3221
|
if (first) pop.style.transition = "none";
|
|
3222
|
+
const cap = cssCapRef.current;
|
|
3223
|
+
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
3216
3224
|
const frozen = frozenMaxRef.current;
|
|
3217
|
-
const effectiveH = frozen == null ?
|
|
3225
|
+
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
3218
3226
|
const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
|
|
3219
3227
|
triggerRect,
|
|
3220
3228
|
popW,
|
|
@@ -3223,8 +3231,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3223
3231
|
);
|
|
3224
3232
|
if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
|
|
3225
3233
|
const maxHeight = frozenMaxRef.current;
|
|
3226
|
-
|
|
3227
|
-
pop.style.
|
|
3234
|
+
const hostRect = (pop.offsetParent ?? pop.parentElement)?.getBoundingClientRect();
|
|
3235
|
+
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
3236
|
+
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
3228
3237
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
3229
3238
|
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
3230
3239
|
directionRef.current = next;
|
|
@@ -3242,6 +3251,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3242
3251
|
scrollParentRef.current = null;
|
|
3243
3252
|
placedRef.current = false;
|
|
3244
3253
|
frozenMaxRef.current = void 0;
|
|
3254
|
+
cssCapRef.current = void 0;
|
|
3245
3255
|
return;
|
|
3246
3256
|
}
|
|
3247
3257
|
if (triggerRef.current) {
|
|
@@ -4025,13 +4035,13 @@ Drawer.displayName = "Drawer";
|
|
|
4025
4035
|
var Drawer_default = Drawer;
|
|
4026
4036
|
|
|
4027
4037
|
// src/components/Dropdown/Dropdown.tsx
|
|
4028
|
-
import
|
|
4038
|
+
import React22 from "react";
|
|
4029
4039
|
|
|
4030
4040
|
// src/tokens/hooks/Portal.tsx
|
|
4031
4041
|
import ReactDOM from "react-dom";
|
|
4032
|
-
var Portal = ({ children }) => {
|
|
4042
|
+
var Portal = ({ children, container }) => {
|
|
4033
4043
|
if (typeof document === "undefined") return null;
|
|
4034
|
-
return ReactDOM.createPortal(children, document.body);
|
|
4044
|
+
return ReactDOM.createPortal(children, container ?? document.body);
|
|
4035
4045
|
};
|
|
4036
4046
|
Portal.displayName = "Portal";
|
|
4037
4047
|
var Portal_default = Portal;
|
|
@@ -4061,15 +4071,42 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
4061
4071
|
};
|
|
4062
4072
|
var useClickOutside_default = useClickOutside;
|
|
4063
4073
|
|
|
4074
|
+
// src/tokens/hooks/useOverlayHost.ts
|
|
4075
|
+
import React21 from "react";
|
|
4076
|
+
var useOverlayHost = (triggerRef, enabled) => {
|
|
4077
|
+
const [host, setHost] = React21.useState(null);
|
|
4078
|
+
React21.useLayoutEffect(() => {
|
|
4079
|
+
if (!enabled || !triggerRef.current) {
|
|
4080
|
+
setHost(null);
|
|
4081
|
+
return;
|
|
4082
|
+
}
|
|
4083
|
+
const el = document.createElement("div");
|
|
4084
|
+
el.dataset.xplatOverlayHost = "";
|
|
4085
|
+
el.style.position = "relative";
|
|
4086
|
+
el.style.width = "0";
|
|
4087
|
+
el.style.height = "0";
|
|
4088
|
+
const parent = findScrollParent(triggerRef.current) ?? document.body;
|
|
4089
|
+
parent.appendChild(el);
|
|
4090
|
+
setHost(el);
|
|
4091
|
+
return () => {
|
|
4092
|
+
el.remove();
|
|
4093
|
+
setHost(null);
|
|
4094
|
+
};
|
|
4095
|
+
}, [enabled, triggerRef]);
|
|
4096
|
+
return host;
|
|
4097
|
+
};
|
|
4098
|
+
var useOverlayHost_default = useOverlayHost;
|
|
4099
|
+
|
|
4064
4100
|
// src/components/Dropdown/Dropdown.tsx
|
|
4065
4101
|
import { jsx as jsx322, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
4066
4102
|
var Dropdown = (props) => {
|
|
4067
4103
|
const { items, children } = props;
|
|
4068
|
-
const [isOpen, setIsOpen] =
|
|
4069
|
-
const [mounted, setMounted] =
|
|
4070
|
-
const [visible, setVisible] =
|
|
4071
|
-
const triggerRef =
|
|
4072
|
-
const menuRef =
|
|
4104
|
+
const [isOpen, setIsOpen] = React22.useState(false);
|
|
4105
|
+
const [mounted, setMounted] = React22.useState(false);
|
|
4106
|
+
const [visible, setVisible] = React22.useState(false);
|
|
4107
|
+
const triggerRef = React22.useRef(null);
|
|
4108
|
+
const menuRef = React22.useRef(null);
|
|
4109
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
4073
4110
|
useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
4074
4111
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
4075
4112
|
useCloseWhenFocusHidden(isOpen, triggerRef, menuRef, () => setIsOpen(false));
|
|
@@ -4077,7 +4114,7 @@ var Dropdown = (props) => {
|
|
|
4077
4114
|
setIsOpen(false);
|
|
4078
4115
|
triggerRef.current?.focus({ preventScroll: true });
|
|
4079
4116
|
});
|
|
4080
|
-
|
|
4117
|
+
React22.useEffect(() => {
|
|
4081
4118
|
if (isOpen) {
|
|
4082
4119
|
setMounted(true);
|
|
4083
4120
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -4102,7 +4139,7 @@ var Dropdown = (props) => {
|
|
|
4102
4139
|
children
|
|
4103
4140
|
}
|
|
4104
4141
|
),
|
|
4105
|
-
mounted && /* @__PURE__ */ jsx322(Portal_default, { children: /* @__PURE__ */ jsx322(
|
|
4142
|
+
mounted && /* @__PURE__ */ jsx322(Portal_default, { container: host, children: /* @__PURE__ */ jsx322(
|
|
4106
4143
|
"div",
|
|
4107
4144
|
{
|
|
4108
4145
|
ref: menuRef,
|
|
@@ -4130,7 +4167,7 @@ Dropdown.displayName = "Dropdown";
|
|
|
4130
4167
|
var Dropdown_default = Dropdown;
|
|
4131
4168
|
|
|
4132
4169
|
// src/components/Editor/Editor.tsx
|
|
4133
|
-
import
|
|
4170
|
+
import React23 from "react";
|
|
4134
4171
|
|
|
4135
4172
|
// src/components/Editor/highlight.ts
|
|
4136
4173
|
var CODE_LANGUAGES = [
|
|
@@ -4401,22 +4438,22 @@ var Editor = (props) => {
|
|
|
4401
4438
|
onImageUpload,
|
|
4402
4439
|
minHeight = 200
|
|
4403
4440
|
} = props;
|
|
4404
|
-
const editorRef =
|
|
4405
|
-
const lastRangeRef =
|
|
4406
|
-
const composingRef =
|
|
4407
|
-
const [isFocused, setIsFocused] =
|
|
4408
|
-
const [isEmpty, setIsEmpty] =
|
|
4409
|
-
const [activeFormats, setActiveFormats] =
|
|
4410
|
-
const [slashOpen, setSlashOpen] =
|
|
4411
|
-
const [slashFilter, setSlashFilter] =
|
|
4412
|
-
const [slashIdx, setSlashIdx] =
|
|
4413
|
-
const [slashPos, setSlashPos] =
|
|
4414
|
-
const slashStartRangeRef =
|
|
4415
|
-
const [linkOpen, setLinkOpen] =
|
|
4416
|
-
const [linkValue, setLinkValue] =
|
|
4417
|
-
const [linkPos, setLinkPos] =
|
|
4418
|
-
const lastEmittedRef =
|
|
4419
|
-
|
|
4441
|
+
const editorRef = React23.useRef(null);
|
|
4442
|
+
const lastRangeRef = React23.useRef(null);
|
|
4443
|
+
const composingRef = React23.useRef(false);
|
|
4444
|
+
const [isFocused, setIsFocused] = React23.useState(false);
|
|
4445
|
+
const [isEmpty, setIsEmpty] = React23.useState(!value);
|
|
4446
|
+
const [activeFormats, setActiveFormats] = React23.useState(/* @__PURE__ */ new Set());
|
|
4447
|
+
const [slashOpen, setSlashOpen] = React23.useState(false);
|
|
4448
|
+
const [slashFilter, setSlashFilter] = React23.useState("");
|
|
4449
|
+
const [slashIdx, setSlashIdx] = React23.useState(0);
|
|
4450
|
+
const [slashPos, setSlashPos] = React23.useState({ top: 0, left: 0 });
|
|
4451
|
+
const slashStartRangeRef = React23.useRef(null);
|
|
4452
|
+
const [linkOpen, setLinkOpen] = React23.useState(false);
|
|
4453
|
+
const [linkValue, setLinkValue] = React23.useState("");
|
|
4454
|
+
const [linkPos, setLinkPos] = React23.useState({ top: 0, left: 0 });
|
|
4455
|
+
const lastEmittedRef = React23.useRef(null);
|
|
4456
|
+
React23.useEffect(() => {
|
|
4420
4457
|
const el = editorRef.current;
|
|
4421
4458
|
if (!el) return;
|
|
4422
4459
|
if (value === lastEmittedRef.current) return;
|
|
@@ -4498,10 +4535,10 @@ var Editor = (props) => {
|
|
|
4498
4535
|
const current = String(document.queryCommandValue("formatBlock") || "").toLowerCase();
|
|
4499
4536
|
setBlock(current === tag ? "p" : tag);
|
|
4500
4537
|
};
|
|
4501
|
-
const historyRef =
|
|
4502
|
-
const historyIdxRef =
|
|
4503
|
-
const lastPushAtRef =
|
|
4504
|
-
const isRestoringRef =
|
|
4538
|
+
const historyRef = React23.useRef([]);
|
|
4539
|
+
const historyIdxRef = React23.useRef(-1);
|
|
4540
|
+
const lastPushAtRef = React23.useRef(0);
|
|
4541
|
+
const isRestoringRef = React23.useRef(false);
|
|
4505
4542
|
const caretOffset = (rootEl) => {
|
|
4506
4543
|
const el = rootEl ?? editorRef.current;
|
|
4507
4544
|
const sel = window.getSelection();
|
|
@@ -4578,8 +4615,8 @@ var Editor = (props) => {
|
|
|
4578
4615
|
const cls = Array.from(pre.classList).find((c) => c.startsWith("lang-"));
|
|
4579
4616
|
return cls?.slice(5) ?? "plain";
|
|
4580
4617
|
};
|
|
4581
|
-
const [codeLang, setCodeLang] =
|
|
4582
|
-
const highlightRafRef =
|
|
4618
|
+
const [codeLang, setCodeLang] = React23.useState("plain");
|
|
4619
|
+
const highlightRafRef = React23.useRef(0);
|
|
4583
4620
|
const rehighlight = (pre) => {
|
|
4584
4621
|
if (composingRef.current) return;
|
|
4585
4622
|
const code = pre.querySelector("code");
|
|
@@ -4924,7 +4961,7 @@ var Editor = (props) => {
|
|
|
4924
4961
|
setSlashIdx(0);
|
|
4925
4962
|
slashStartRangeRef.current = null;
|
|
4926
4963
|
};
|
|
4927
|
-
const filteredSlashItems =
|
|
4964
|
+
const filteredSlashItems = React23.useMemo(() => {
|
|
4928
4965
|
if (!slashFilter) return SLASH_ITEMS;
|
|
4929
4966
|
const f = slashFilter.toLowerCase();
|
|
4930
4967
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -5189,7 +5226,7 @@ var Editor = (props) => {
|
|
|
5189
5226
|
}
|
|
5190
5227
|
}
|
|
5191
5228
|
};
|
|
5192
|
-
const plainPasteRef =
|
|
5229
|
+
const plainPasteRef = React23.useRef(false);
|
|
5193
5230
|
const handlePaste = (e) => {
|
|
5194
5231
|
if (readOnly) return;
|
|
5195
5232
|
e.preventDefault();
|
|
@@ -5490,7 +5527,7 @@ var EditorToolbar = ({
|
|
|
5490
5527
|
] });
|
|
5491
5528
|
};
|
|
5492
5529
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
5493
|
-
|
|
5530
|
+
React23.useEffect(() => {
|
|
5494
5531
|
const handleClickOutside = (e) => {
|
|
5495
5532
|
const target = e.target;
|
|
5496
5533
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -5524,8 +5561,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
5524
5561
|
);
|
|
5525
5562
|
};
|
|
5526
5563
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
5527
|
-
const inputRef =
|
|
5528
|
-
|
|
5564
|
+
const inputRef = React23.useRef(null);
|
|
5565
|
+
React23.useEffect(() => {
|
|
5529
5566
|
inputRef.current?.focus();
|
|
5530
5567
|
}, []);
|
|
5531
5568
|
return /* @__PURE__ */ jsxs207(
|
|
@@ -5583,7 +5620,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
5583
5620
|
var EmptyState_default = EmptyState;
|
|
5584
5621
|
|
|
5585
5622
|
// src/components/FileUpload/FileUpload.tsx
|
|
5586
|
-
import
|
|
5623
|
+
import React24 from "react";
|
|
5587
5624
|
import { jsx as jsx325, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
5588
5625
|
var FileUpload = (props) => {
|
|
5589
5626
|
const {
|
|
@@ -5597,9 +5634,9 @@ var FileUpload = (props) => {
|
|
|
5597
5634
|
label,
|
|
5598
5635
|
required
|
|
5599
5636
|
} = props;
|
|
5600
|
-
const fieldId =
|
|
5601
|
-
const [isDragOver, setIsDragOver] =
|
|
5602
|
-
const inputRef =
|
|
5637
|
+
const fieldId = React24.useId();
|
|
5638
|
+
const [isDragOver, setIsDragOver] = React24.useState(false);
|
|
5639
|
+
const inputRef = React24.useRef(null);
|
|
5603
5640
|
const handleFiles = (fileList) => {
|
|
5604
5641
|
let files = Array.from(fileList);
|
|
5605
5642
|
if (maxSize) {
|
|
@@ -5662,10 +5699,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
5662
5699
|
var FileUpload_default = FileUpload;
|
|
5663
5700
|
|
|
5664
5701
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
5665
|
-
import
|
|
5702
|
+
import React26 from "react";
|
|
5666
5703
|
|
|
5667
5704
|
// src/components/HtmlTypeWriter/utils.ts
|
|
5668
|
-
import
|
|
5705
|
+
import React25 from "react";
|
|
5669
5706
|
var voidTags = /* @__PURE__ */ new Set([
|
|
5670
5707
|
"br",
|
|
5671
5708
|
"img",
|
|
@@ -5733,15 +5770,15 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
5733
5770
|
props[attr.name] = attr.value;
|
|
5734
5771
|
});
|
|
5735
5772
|
if (voidTags.has(tag)) {
|
|
5736
|
-
return
|
|
5773
|
+
return React25.createElement(tag, props);
|
|
5737
5774
|
}
|
|
5738
5775
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
5739
|
-
return
|
|
5776
|
+
return React25.createElement(tag, props, ...children);
|
|
5740
5777
|
};
|
|
5741
5778
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
5742
5779
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
5743
5780
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
5744
|
-
return node == null ? null :
|
|
5781
|
+
return node == null ? null : React25.createElement(React25.Fragment, { key: idx }, node);
|
|
5745
5782
|
}).filter(Boolean);
|
|
5746
5783
|
return nodes.length === 0 ? null : nodes;
|
|
5747
5784
|
};
|
|
@@ -5754,20 +5791,20 @@ var HtmlTypeWriter = ({
|
|
|
5754
5791
|
onDone,
|
|
5755
5792
|
onChange
|
|
5756
5793
|
}) => {
|
|
5757
|
-
const [typedLen, setTypedLen] =
|
|
5758
|
-
const doneCalledRef =
|
|
5759
|
-
const { doc, rangeMap, totalLength } =
|
|
5794
|
+
const [typedLen, setTypedLen] = React26.useState(0);
|
|
5795
|
+
const doneCalledRef = React26.useRef(false);
|
|
5796
|
+
const { doc, rangeMap, totalLength } = React26.useMemo(() => {
|
|
5760
5797
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
5761
5798
|
const decoded = decodeHtmlEntities(html);
|
|
5762
5799
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
5763
5800
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
5764
5801
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
5765
5802
|
}, [html]);
|
|
5766
|
-
|
|
5803
|
+
React26.useEffect(() => {
|
|
5767
5804
|
setTypedLen(0);
|
|
5768
5805
|
doneCalledRef.current = false;
|
|
5769
5806
|
}, [html]);
|
|
5770
|
-
|
|
5807
|
+
React26.useEffect(() => {
|
|
5771
5808
|
if (!totalLength) return;
|
|
5772
5809
|
if (typedLen >= totalLength) return;
|
|
5773
5810
|
const timer = window.setInterval(() => {
|
|
@@ -5775,18 +5812,18 @@ var HtmlTypeWriter = ({
|
|
|
5775
5812
|
}, duration);
|
|
5776
5813
|
return () => window.clearInterval(timer);
|
|
5777
5814
|
}, [typedLen, totalLength, duration]);
|
|
5778
|
-
|
|
5815
|
+
React26.useEffect(() => {
|
|
5779
5816
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
5780
5817
|
onChange?.();
|
|
5781
5818
|
}
|
|
5782
5819
|
}, [typedLen, totalLength, onChange]);
|
|
5783
|
-
|
|
5820
|
+
React26.useEffect(() => {
|
|
5784
5821
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
5785
5822
|
doneCalledRef.current = true;
|
|
5786
5823
|
onDone?.();
|
|
5787
5824
|
}
|
|
5788
5825
|
}, [typedLen, totalLength, onDone]);
|
|
5789
|
-
const parsed =
|
|
5826
|
+
const parsed = React26.useMemo(
|
|
5790
5827
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
5791
5828
|
[doc, typedLen, rangeMap]
|
|
5792
5829
|
);
|
|
@@ -5796,13 +5833,13 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
|
5796
5833
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
5797
5834
|
|
|
5798
5835
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
5799
|
-
import
|
|
5836
|
+
import React27 from "react";
|
|
5800
5837
|
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
5801
5838
|
var ImageSelector = (props) => {
|
|
5802
5839
|
const { value, placeholder, onChange, validations, label, required } = props;
|
|
5803
|
-
const fieldId =
|
|
5804
|
-
const [previewUrl, setPreviewUrl] =
|
|
5805
|
-
|
|
5840
|
+
const fieldId = React27.useId();
|
|
5841
|
+
const [previewUrl, setPreviewUrl] = React27.useState();
|
|
5842
|
+
React27.useEffect(() => {
|
|
5806
5843
|
if (!value) {
|
|
5807
5844
|
setPreviewUrl(void 0);
|
|
5808
5845
|
return;
|
|
@@ -5811,7 +5848,7 @@ var ImageSelector = (props) => {
|
|
|
5811
5848
|
setPreviewUrl(url);
|
|
5812
5849
|
return () => URL.revokeObjectURL(url);
|
|
5813
5850
|
}, [value]);
|
|
5814
|
-
const inputRef =
|
|
5851
|
+
const inputRef = React27.useRef(null);
|
|
5815
5852
|
const handleFileChange = (e) => {
|
|
5816
5853
|
const selectedFile = e.target.files?.[0];
|
|
5817
5854
|
if (selectedFile) {
|
|
@@ -5994,22 +6031,23 @@ Pagination.displayName = "Pagination";
|
|
|
5994
6031
|
var Pagination_default = Pagination;
|
|
5995
6032
|
|
|
5996
6033
|
// src/components/PopOver/PopOver.tsx
|
|
5997
|
-
import
|
|
6034
|
+
import React28 from "react";
|
|
5998
6035
|
import { jsx as jsx332, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
5999
6036
|
var PopOver = (props) => {
|
|
6000
6037
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
6001
|
-
const popRef =
|
|
6002
|
-
const triggerRef =
|
|
6003
|
-
const [localOpen, setLocalOpen] =
|
|
6004
|
-
const [eventTrigger, setEventTrigger] =
|
|
6038
|
+
const popRef = React28.useRef(null);
|
|
6039
|
+
const triggerRef = React28.useRef(null);
|
|
6040
|
+
const [localOpen, setLocalOpen] = React28.useState(false);
|
|
6041
|
+
const [eventTrigger, setEventTrigger] = React28.useState(false);
|
|
6005
6042
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
6006
6043
|
useCloseWhenFocusHidden(isOpen, triggerRef, popRef, onClose);
|
|
6007
6044
|
useEscapeKey(isOpen, () => {
|
|
6008
6045
|
onClose();
|
|
6009
6046
|
triggerRef.current?.focus({ preventScroll: true });
|
|
6010
6047
|
});
|
|
6048
|
+
const host = useOverlayHost_default(triggerRef, localOpen);
|
|
6011
6049
|
useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
6012
|
-
|
|
6050
|
+
React28.useEffect(() => {
|
|
6013
6051
|
if (isOpen) {
|
|
6014
6052
|
setLocalOpen(isOpen);
|
|
6015
6053
|
setTimeout(() => {
|
|
@@ -6032,7 +6070,7 @@ var PopOver = (props) => {
|
|
|
6032
6070
|
},
|
|
6033
6071
|
children: [
|
|
6034
6072
|
children,
|
|
6035
|
-
localOpen && /* @__PURE__ */ jsx332(Portal_default, { children: /* @__PURE__ */ jsx332(
|
|
6073
|
+
localOpen && /* @__PURE__ */ jsx332(Portal_default, { container: host, children: /* @__PURE__ */ jsx332(
|
|
6036
6074
|
"div",
|
|
6037
6075
|
{
|
|
6038
6076
|
className: clsx_default(
|
|
@@ -6090,12 +6128,12 @@ Progress.displayName = "Progress";
|
|
|
6090
6128
|
var Progress_default = Progress;
|
|
6091
6129
|
|
|
6092
6130
|
// src/components/Radio/RadioGroupContext.tsx
|
|
6093
|
-
import
|
|
6094
|
-
var RadioGroupContext =
|
|
6131
|
+
import React29 from "react";
|
|
6132
|
+
var RadioGroupContext = React29.createContext(
|
|
6095
6133
|
null
|
|
6096
6134
|
);
|
|
6097
6135
|
var useRadioGroupContext = () => {
|
|
6098
|
-
return
|
|
6136
|
+
return React29.useContext(RadioGroupContext);
|
|
6099
6137
|
};
|
|
6100
6138
|
var RadioGroupContext_default = RadioGroupContext;
|
|
6101
6139
|
|
|
@@ -6171,19 +6209,19 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
6171
6209
|
var RadioGroup_default = RadioGroup;
|
|
6172
6210
|
|
|
6173
6211
|
// src/components/Select/Select.tsx
|
|
6174
|
-
import
|
|
6212
|
+
import React32 from "react";
|
|
6175
6213
|
|
|
6176
6214
|
// src/components/Select/context.ts
|
|
6177
|
-
import
|
|
6178
|
-
var SelectContext =
|
|
6215
|
+
import React30 from "react";
|
|
6216
|
+
var SelectContext = React30.createContext(null);
|
|
6179
6217
|
var context_default = SelectContext;
|
|
6180
6218
|
|
|
6181
6219
|
// src/components/Select/SelectItem.tsx
|
|
6182
|
-
import
|
|
6220
|
+
import React31 from "react";
|
|
6183
6221
|
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
6184
6222
|
var SelectItem = (props) => {
|
|
6185
6223
|
const { children, value, onClick, disabled = false } = props;
|
|
6186
|
-
const ctx =
|
|
6224
|
+
const ctx = React31.useContext(context_default);
|
|
6187
6225
|
const handleClick = (e) => {
|
|
6188
6226
|
e.preventDefault();
|
|
6189
6227
|
e.stopPropagation();
|
|
@@ -6233,29 +6271,29 @@ var SelectRoot = (props) => {
|
|
|
6233
6271
|
required,
|
|
6234
6272
|
size = "md"
|
|
6235
6273
|
} = props;
|
|
6236
|
-
const fieldId =
|
|
6237
|
-
const itemChildren =
|
|
6238
|
-
(child) =>
|
|
6274
|
+
const fieldId = React32.useId();
|
|
6275
|
+
const itemChildren = React32.Children.toArray(children).filter(
|
|
6276
|
+
(child) => React32.isValidElement(child) && child.type === SelectItem_default
|
|
6239
6277
|
);
|
|
6240
6278
|
const isControlled = valueProp !== void 0;
|
|
6241
|
-
const [isOpen, setOpen] =
|
|
6242
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
6243
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6244
|
-
const controlledLabel =
|
|
6279
|
+
const [isOpen, setOpen] = React32.useState(false);
|
|
6280
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React32.useState(null);
|
|
6281
|
+
const [uncontrolledValue, setUncontrolledValue] = React32.useState(void 0);
|
|
6282
|
+
const controlledLabel = React32.useMemo(() => {
|
|
6245
6283
|
if (!isControlled) return null;
|
|
6246
6284
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
6247
6285
|
return match ? match.props.children : null;
|
|
6248
6286
|
}, [isControlled, valueProp, itemChildren]);
|
|
6249
6287
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
6250
6288
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
6251
|
-
const triggerRef =
|
|
6252
|
-
const contentRef =
|
|
6253
|
-
const [mounted, setMounted] =
|
|
6254
|
-
const [visible, setVisible] =
|
|
6255
|
-
|
|
6289
|
+
const triggerRef = React32.useRef(null);
|
|
6290
|
+
const contentRef = React32.useRef(null);
|
|
6291
|
+
const [mounted, setMounted] = React32.useState(false);
|
|
6292
|
+
const [visible, setVisible] = React32.useState(false);
|
|
6293
|
+
React32.useEffect(() => {
|
|
6256
6294
|
if (disabled && isOpen) setOpen(false);
|
|
6257
6295
|
}, [disabled, isOpen]);
|
|
6258
|
-
|
|
6296
|
+
React32.useEffect(() => {
|
|
6259
6297
|
if (isOpen) {
|
|
6260
6298
|
setMounted(true);
|
|
6261
6299
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -6265,33 +6303,34 @@ var SelectRoot = (props) => {
|
|
|
6265
6303
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
6266
6304
|
return () => clearTimeout(t);
|
|
6267
6305
|
}, [isOpen]);
|
|
6268
|
-
const [query, setQuery] =
|
|
6306
|
+
const [query, setQuery] = React32.useState("");
|
|
6269
6307
|
const textOf = (node) => {
|
|
6270
6308
|
if (node === null || node === void 0 || typeof node === "boolean") return "";
|
|
6271
6309
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
6272
6310
|
if (Array.isArray(node)) return node.map(textOf).join("");
|
|
6273
|
-
if (
|
|
6311
|
+
if (React32.isValidElement(node)) return textOf(node.props.children);
|
|
6274
6312
|
return "";
|
|
6275
6313
|
};
|
|
6276
|
-
const visibleItems =
|
|
6314
|
+
const visibleItems = React32.useMemo(() => {
|
|
6277
6315
|
if (!searchable || !query.trim()) return itemChildren;
|
|
6278
6316
|
const q = query.trim().toLowerCase();
|
|
6279
6317
|
return itemChildren.filter((c) => textOf(c.props.children).toLowerCase().includes(q));
|
|
6280
6318
|
}, [searchable, query, itemChildren]);
|
|
6281
|
-
const open =
|
|
6282
|
-
const close =
|
|
6319
|
+
const open = React32.useCallback(() => setOpen(true), []);
|
|
6320
|
+
const close = React32.useCallback(() => {
|
|
6283
6321
|
setOpen(false);
|
|
6284
6322
|
setQuery("");
|
|
6285
6323
|
}, []);
|
|
6286
|
-
const toggle =
|
|
6324
|
+
const toggle = React32.useCallback(() => setOpen((prev) => !prev), []);
|
|
6287
6325
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
6288
6326
|
useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
|
|
6289
6327
|
useEscapeKey(isOpen, () => {
|
|
6290
6328
|
close();
|
|
6291
6329
|
triggerRef.current?.focus({ preventScroll: true });
|
|
6292
6330
|
});
|
|
6331
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
6293
6332
|
useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
6294
|
-
const setSelected =
|
|
6333
|
+
const setSelected = React32.useCallback(
|
|
6295
6334
|
(label2, itemValue) => {
|
|
6296
6335
|
if (!isControlled) {
|
|
6297
6336
|
setUncontrolledLabel(label2);
|
|
@@ -6301,7 +6340,7 @@ var SelectRoot = (props) => {
|
|
|
6301
6340
|
},
|
|
6302
6341
|
[isControlled, onChange]
|
|
6303
6342
|
);
|
|
6304
|
-
const ctxValue =
|
|
6343
|
+
const ctxValue = React32.useMemo(
|
|
6305
6344
|
() => ({
|
|
6306
6345
|
isOpen,
|
|
6307
6346
|
mounted,
|
|
@@ -6380,7 +6419,7 @@ var SelectRoot = (props) => {
|
|
|
6380
6419
|
]
|
|
6381
6420
|
}
|
|
6382
6421
|
),
|
|
6383
|
-
mounted && /* @__PURE__ */ jsx337(Portal_default, { children: /* @__PURE__ */ jsxs216(
|
|
6422
|
+
mounted && /* @__PURE__ */ jsx337(Portal_default, { container: host, children: /* @__PURE__ */ jsxs216(
|
|
6384
6423
|
"div",
|
|
6385
6424
|
{
|
|
6386
6425
|
className: clsx_default("lib-xplat-select-content", size, stateClass),
|
|
@@ -6546,7 +6585,7 @@ Steps.displayName = "Steps";
|
|
|
6546
6585
|
var Steps_default = Steps;
|
|
6547
6586
|
|
|
6548
6587
|
// src/components/Swiper/Swiper.tsx
|
|
6549
|
-
import
|
|
6588
|
+
import React33 from "react";
|
|
6550
6589
|
import { jsx as jsx342, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
6551
6590
|
var Swiper = (props) => {
|
|
6552
6591
|
const {
|
|
@@ -6571,26 +6610,26 @@ var Swiper = (props) => {
|
|
|
6571
6610
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
6572
6611
|
const useLoop = loop && canSlide;
|
|
6573
6612
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
6574
|
-
const extendedItems =
|
|
6613
|
+
const extendedItems = React33.useMemo(() => {
|
|
6575
6614
|
if (!useLoop) return items;
|
|
6576
6615
|
return [...items, ...items, ...items];
|
|
6577
6616
|
}, [items, useLoop]);
|
|
6578
6617
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
6579
|
-
const [innerIndex, setInnerIndex] =
|
|
6618
|
+
const [innerIndex, setInnerIndex] = React33.useState(
|
|
6580
6619
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
6581
6620
|
);
|
|
6582
|
-
const [isDragging, setIsDragging] =
|
|
6583
|
-
const [dragOffset, setDragOffset] =
|
|
6584
|
-
const [animated, setAnimated] =
|
|
6585
|
-
const [containerWidth, setContainerWidth] =
|
|
6586
|
-
const containerRef =
|
|
6587
|
-
const startXRef =
|
|
6588
|
-
const startTimeRef =
|
|
6589
|
-
const autoplayTimerRef =
|
|
6590
|
-
const resumeTimeoutRef =
|
|
6591
|
-
const [paused, setPaused] =
|
|
6592
|
-
const initializedRef =
|
|
6593
|
-
|
|
6621
|
+
const [isDragging, setIsDragging] = React33.useState(false);
|
|
6622
|
+
const [dragOffset, setDragOffset] = React33.useState(0);
|
|
6623
|
+
const [animated, setAnimated] = React33.useState(false);
|
|
6624
|
+
const [containerWidth, setContainerWidth] = React33.useState(0);
|
|
6625
|
+
const containerRef = React33.useRef(null);
|
|
6626
|
+
const startXRef = React33.useRef(0);
|
|
6627
|
+
const startTimeRef = React33.useRef(0);
|
|
6628
|
+
const autoplayTimerRef = React33.useRef(null);
|
|
6629
|
+
const resumeTimeoutRef = React33.useRef(null);
|
|
6630
|
+
const [paused, setPaused] = React33.useState(false);
|
|
6631
|
+
const initializedRef = React33.useRef(false);
|
|
6632
|
+
React33.useEffect(() => {
|
|
6594
6633
|
const el = containerRef.current;
|
|
6595
6634
|
if (!el) return;
|
|
6596
6635
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -6613,7 +6652,7 @@ var Swiper = (props) => {
|
|
|
6613
6652
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
6614
6653
|
};
|
|
6615
6654
|
const realIndex = getRealIndex(innerIndex);
|
|
6616
|
-
const moveToInner =
|
|
6655
|
+
const moveToInner = React33.useCallback(
|
|
6617
6656
|
(idx, withAnim = true) => {
|
|
6618
6657
|
if (!useLoop) {
|
|
6619
6658
|
setAnimated(withAnim);
|
|
@@ -6641,7 +6680,7 @@ var Swiper = (props) => {
|
|
|
6641
6680
|
},
|
|
6642
6681
|
[useLoop, cloneCount, totalSlides]
|
|
6643
6682
|
);
|
|
6644
|
-
const handleTransitionEnd =
|
|
6683
|
+
const handleTransitionEnd = React33.useCallback(() => {
|
|
6645
6684
|
if (!useLoop) return;
|
|
6646
6685
|
const real = getRealIndex(innerIndex);
|
|
6647
6686
|
const canonical = cloneCount + real;
|
|
@@ -6651,7 +6690,7 @@ var Swiper = (props) => {
|
|
|
6651
6690
|
}
|
|
6652
6691
|
onChange?.(Math.min(real, maxIndex));
|
|
6653
6692
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
6654
|
-
const slideTo =
|
|
6693
|
+
const slideTo = React33.useCallback(
|
|
6655
6694
|
(logicalIndex) => {
|
|
6656
6695
|
if (!canSlide) return;
|
|
6657
6696
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -6661,7 +6700,7 @@ var Swiper = (props) => {
|
|
|
6661
6700
|
},
|
|
6662
6701
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
6663
6702
|
);
|
|
6664
|
-
const slideNext =
|
|
6703
|
+
const slideNext = React33.useCallback(() => {
|
|
6665
6704
|
if (!canSlide) return;
|
|
6666
6705
|
const nextInner = innerIndex + slideBy;
|
|
6667
6706
|
if (useLoop) {
|
|
@@ -6670,7 +6709,7 @@ var Swiper = (props) => {
|
|
|
6670
6709
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
6671
6710
|
}
|
|
6672
6711
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
6673
|
-
const slidePrev =
|
|
6712
|
+
const slidePrev = React33.useCallback(() => {
|
|
6674
6713
|
if (!canSlide) return;
|
|
6675
6714
|
const prevInner = innerIndex - slideBy;
|
|
6676
6715
|
if (useLoop) {
|
|
@@ -6679,7 +6718,7 @@ var Swiper = (props) => {
|
|
|
6679
6718
|
moveToInner(Math.max(prevInner, 0), true);
|
|
6680
6719
|
}
|
|
6681
6720
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
6682
|
-
|
|
6721
|
+
React33.useEffect(() => {
|
|
6683
6722
|
if (indexProp === void 0) return;
|
|
6684
6723
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
6685
6724
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -6687,12 +6726,12 @@ var Swiper = (props) => {
|
|
|
6687
6726
|
moveToInner(target, true);
|
|
6688
6727
|
}
|
|
6689
6728
|
}, [indexProp]);
|
|
6690
|
-
|
|
6729
|
+
React33.useImperativeHandle(swiperRef, () => ({
|
|
6691
6730
|
slidePrev,
|
|
6692
6731
|
slideNext,
|
|
6693
6732
|
slideTo
|
|
6694
6733
|
}));
|
|
6695
|
-
|
|
6734
|
+
React33.useEffect(() => {
|
|
6696
6735
|
if (!auto || !canSlide || paused) return;
|
|
6697
6736
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
6698
6737
|
return () => {
|
|
@@ -6718,7 +6757,7 @@ var Swiper = (props) => {
|
|
|
6718
6757
|
resumeTimeoutRef.current = null;
|
|
6719
6758
|
}, pauseOnInteraction);
|
|
6720
6759
|
};
|
|
6721
|
-
|
|
6760
|
+
React33.useEffect(() => {
|
|
6722
6761
|
return () => {
|
|
6723
6762
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
6724
6763
|
};
|
|
@@ -6736,7 +6775,7 @@ var Swiper = (props) => {
|
|
|
6736
6775
|
startXRef.current = getClientX(e);
|
|
6737
6776
|
startTimeRef.current = Date.now();
|
|
6738
6777
|
};
|
|
6739
|
-
|
|
6778
|
+
React33.useEffect(() => {
|
|
6740
6779
|
if (!isDragging) return;
|
|
6741
6780
|
const handleMove = (e) => {
|
|
6742
6781
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -6775,7 +6814,7 @@ var Swiper = (props) => {
|
|
|
6775
6814
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
6776
6815
|
const slideWidthPercent = 100 / viewItemCount;
|
|
6777
6816
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
6778
|
-
const slideElements =
|
|
6817
|
+
const slideElements = React33.useMemo(
|
|
6779
6818
|
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx342(
|
|
6780
6819
|
"div",
|
|
6781
6820
|
{
|
|
@@ -6849,7 +6888,7 @@ Swiper.displayName = "Swiper";
|
|
|
6849
6888
|
var Swiper_default = Swiper;
|
|
6850
6889
|
|
|
6851
6890
|
// src/components/Switch/Switch.tsx
|
|
6852
|
-
import
|
|
6891
|
+
import React34 from "react";
|
|
6853
6892
|
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
6854
6893
|
var KNOB_TRANSITION_MS = 250;
|
|
6855
6894
|
var Switch = (props) => {
|
|
@@ -6863,11 +6902,11 @@ var Switch = (props) => {
|
|
|
6863
6902
|
label,
|
|
6864
6903
|
required
|
|
6865
6904
|
} = props;
|
|
6866
|
-
const fieldId =
|
|
6905
|
+
const fieldId = React34.useId();
|
|
6867
6906
|
const statusType = normalizeStatus(type);
|
|
6868
|
-
const [isAnimating, setIsAnimating] =
|
|
6869
|
-
const timeoutRef =
|
|
6870
|
-
|
|
6907
|
+
const [isAnimating, setIsAnimating] = React34.useState(false);
|
|
6908
|
+
const timeoutRef = React34.useRef(null);
|
|
6909
|
+
React34.useEffect(() => {
|
|
6871
6910
|
return () => {
|
|
6872
6911
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6873
6912
|
};
|
|
@@ -6906,10 +6945,10 @@ Switch.displayName = "Switch";
|
|
|
6906
6945
|
var Switch_default = Switch;
|
|
6907
6946
|
|
|
6908
6947
|
// src/components/Table/TableContext.tsx
|
|
6909
|
-
import
|
|
6910
|
-
var TableContext =
|
|
6948
|
+
import React35 from "react";
|
|
6949
|
+
var TableContext = React35.createContext(null);
|
|
6911
6950
|
var useTableContext = () => {
|
|
6912
|
-
const ctx =
|
|
6951
|
+
const ctx = React35.useContext(TableContext);
|
|
6913
6952
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
6914
6953
|
return ctx;
|
|
6915
6954
|
};
|
|
@@ -6952,24 +6991,24 @@ TableBody.displayName = "TableBody";
|
|
|
6952
6991
|
var TableBody_default = TableBody;
|
|
6953
6992
|
|
|
6954
6993
|
// src/components/Table/TableCell.tsx
|
|
6955
|
-
import
|
|
6994
|
+
import React38 from "react";
|
|
6956
6995
|
|
|
6957
6996
|
// src/components/Table/TableHeadContext.tsx
|
|
6958
|
-
import
|
|
6959
|
-
var TableHeadContext =
|
|
6997
|
+
import React36 from "react";
|
|
6998
|
+
var TableHeadContext = React36.createContext(
|
|
6960
6999
|
null
|
|
6961
7000
|
);
|
|
6962
7001
|
var useTableHeadContext = () => {
|
|
6963
|
-
const ctx =
|
|
7002
|
+
const ctx = React36.useContext(TableHeadContext);
|
|
6964
7003
|
return ctx;
|
|
6965
7004
|
};
|
|
6966
7005
|
var TableHeadContext_default = TableHeadContext;
|
|
6967
7006
|
|
|
6968
7007
|
// src/components/Table/TableRowContext.tsx
|
|
6969
|
-
import
|
|
6970
|
-
var TableRowContext =
|
|
7008
|
+
import React37 from "react";
|
|
7009
|
+
var TableRowContext = React37.createContext(null);
|
|
6971
7010
|
var useTableRowContext = () => {
|
|
6972
|
-
const ctx =
|
|
7011
|
+
const ctx = React37.useContext(TableRowContext);
|
|
6973
7012
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
6974
7013
|
return ctx;
|
|
6975
7014
|
};
|
|
@@ -6977,7 +7016,7 @@ var TableRowContext_default = TableRowContext;
|
|
|
6977
7016
|
|
|
6978
7017
|
// src/components/Table/TableCell.tsx
|
|
6979
7018
|
import { jsx as jsx346 } from "react/jsx-runtime";
|
|
6980
|
-
var TableCell =
|
|
7019
|
+
var TableCell = React38.memo((props) => {
|
|
6981
7020
|
const {
|
|
6982
7021
|
children,
|
|
6983
7022
|
align = "center",
|
|
@@ -6991,9 +7030,9 @@ var TableCell = React37.memo((props) => {
|
|
|
6991
7030
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
6992
7031
|
const { stickyShadow } = useTableContext();
|
|
6993
7032
|
const headContext = useTableHeadContext();
|
|
6994
|
-
const [left, setLeft] =
|
|
6995
|
-
const cellRef =
|
|
6996
|
-
const calculateLeft =
|
|
7033
|
+
const [left, setLeft] = React38.useState(0);
|
|
7034
|
+
const cellRef = React38.useRef(null);
|
|
7035
|
+
const calculateLeft = React38.useCallback(() => {
|
|
6997
7036
|
if (!cellRef.current) return 0;
|
|
6998
7037
|
let totalLeft = 0;
|
|
6999
7038
|
for (const ref of stickyCells) {
|
|
@@ -7002,7 +7041,7 @@ var TableCell = React37.memo((props) => {
|
|
|
7002
7041
|
}
|
|
7003
7042
|
return totalLeft;
|
|
7004
7043
|
}, [stickyCells]);
|
|
7005
|
-
|
|
7044
|
+
React38.useEffect(() => {
|
|
7006
7045
|
if (!isSticky || !cellRef.current) return;
|
|
7007
7046
|
registerStickyCell(cellRef);
|
|
7008
7047
|
setLeft(calculateLeft());
|
|
@@ -7060,9 +7099,9 @@ TableHead.displayName = "TableHead";
|
|
|
7060
7099
|
var TableHead_default = TableHead;
|
|
7061
7100
|
|
|
7062
7101
|
// src/components/Table/TableRow.tsx
|
|
7063
|
-
import
|
|
7102
|
+
import React39 from "react";
|
|
7064
7103
|
import { jsx as jsx348 } from "react/jsx-runtime";
|
|
7065
|
-
var TableRow =
|
|
7104
|
+
var TableRow = React39.memo((props) => {
|
|
7066
7105
|
const {
|
|
7067
7106
|
children,
|
|
7068
7107
|
type = "secondary",
|
|
@@ -7071,7 +7110,7 @@ var TableRow = React38.memo((props) => {
|
|
|
7071
7110
|
onClick
|
|
7072
7111
|
} = props;
|
|
7073
7112
|
const { rowBorderUse } = useTableContext();
|
|
7074
|
-
const [stickyCells, setStickyCells] =
|
|
7113
|
+
const [stickyCells, setStickyCells] = React39.useState([]);
|
|
7075
7114
|
const registerStickyCell = (ref) => {
|
|
7076
7115
|
setStickyCells((prev) => {
|
|
7077
7116
|
if (prev.includes(ref)) return prev;
|
|
@@ -7135,9 +7174,9 @@ Tag.displayName = "Tag";
|
|
|
7135
7174
|
var Tag_default = Tag;
|
|
7136
7175
|
|
|
7137
7176
|
// src/components/TextArea/TextArea.tsx
|
|
7138
|
-
import
|
|
7177
|
+
import React40 from "react";
|
|
7139
7178
|
import { jsx as jsx350 } from "react/jsx-runtime";
|
|
7140
|
-
var TextArea =
|
|
7179
|
+
var TextArea = React40.forwardRef(
|
|
7141
7180
|
(props, ref) => {
|
|
7142
7181
|
const {
|
|
7143
7182
|
className,
|
|
@@ -7150,7 +7189,7 @@ var TextArea = React39.forwardRef(
|
|
|
7150
7189
|
disabled,
|
|
7151
7190
|
...textareaProps
|
|
7152
7191
|
} = props;
|
|
7153
|
-
const autoId =
|
|
7192
|
+
const autoId = React40.useId();
|
|
7154
7193
|
const fieldId = props.id ?? autoId;
|
|
7155
7194
|
const control = /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx350(
|
|
7156
7195
|
"textarea",
|
|
@@ -7172,7 +7211,7 @@ TextArea.displayName = "TextArea";
|
|
|
7172
7211
|
var TextArea_default = TextArea;
|
|
7173
7212
|
|
|
7174
7213
|
// src/components/TimePicker/TimePicker.tsx
|
|
7175
|
-
import
|
|
7214
|
+
import React41 from "react";
|
|
7176
7215
|
import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
7177
7216
|
var ANIMATION_DURATION_MS4 = 200;
|
|
7178
7217
|
var toMinutes = (hhmm) => {
|
|
@@ -7210,13 +7249,13 @@ var TimePicker = (props) => {
|
|
|
7210
7249
|
required,
|
|
7211
7250
|
validations
|
|
7212
7251
|
} = props;
|
|
7213
|
-
const fieldId =
|
|
7214
|
-
const triggerRef =
|
|
7215
|
-
const contentRef =
|
|
7216
|
-
const [isOpen, setOpen] =
|
|
7217
|
-
const [mounted, setMounted] =
|
|
7218
|
-
const [visible, setVisible] =
|
|
7219
|
-
const options =
|
|
7252
|
+
const fieldId = React41.useId();
|
|
7253
|
+
const triggerRef = React41.useRef(null);
|
|
7254
|
+
const contentRef = React41.useRef(null);
|
|
7255
|
+
const [isOpen, setOpen] = React41.useState(false);
|
|
7256
|
+
const [mounted, setMounted] = React41.useState(false);
|
|
7257
|
+
const [visible, setVisible] = React41.useState(false);
|
|
7258
|
+
const options = React41.useMemo(() => {
|
|
7220
7259
|
const safeStep = step > 0 && step <= 720 ? step : 30;
|
|
7221
7260
|
const lo = toMinutes(min) ?? 0;
|
|
7222
7261
|
const hi = toMinutes(max) ?? 24 * 60 - 1;
|
|
@@ -7224,18 +7263,19 @@ var TimePicker = (props) => {
|
|
|
7224
7263
|
for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
|
|
7225
7264
|
return out;
|
|
7226
7265
|
}, [step, min, max]);
|
|
7227
|
-
const close =
|
|
7266
|
+
const close = React41.useCallback(() => setOpen(false), []);
|
|
7228
7267
|
useClickOutside_default([triggerRef, contentRef], close, isOpen);
|
|
7229
7268
|
useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
|
|
7230
7269
|
useEscapeKey(isOpen, () => {
|
|
7231
7270
|
close();
|
|
7232
7271
|
triggerRef.current?.focus({ preventScroll: true });
|
|
7233
7272
|
});
|
|
7273
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
7234
7274
|
useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
7235
|
-
|
|
7275
|
+
React41.useEffect(() => {
|
|
7236
7276
|
if (disabled && isOpen) setOpen(false);
|
|
7237
7277
|
}, [disabled, isOpen]);
|
|
7238
|
-
|
|
7278
|
+
React41.useEffect(() => {
|
|
7239
7279
|
if (isOpen) {
|
|
7240
7280
|
setMounted(true);
|
|
7241
7281
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7273,7 +7313,7 @@ var TimePicker = (props) => {
|
|
|
7273
7313
|
children: /* @__PURE__ */ jsx351("span", { className: clsx_default("time-picker-value", !value && "placeholder"), children: value ? display(value, use12Hours) : placeholder })
|
|
7274
7314
|
}
|
|
7275
7315
|
),
|
|
7276
|
-
mounted && /* @__PURE__ */ jsx351(Portal_default, { children: /* @__PURE__ */ jsx351(
|
|
7316
|
+
mounted && /* @__PURE__ */ jsx351(Portal_default, { container: host, children: /* @__PURE__ */ jsx351(
|
|
7277
7317
|
"div",
|
|
7278
7318
|
{
|
|
7279
7319
|
ref: contentRef,
|
|
@@ -7307,20 +7347,20 @@ TimePicker.displayName = "TimePicker";
|
|
|
7307
7347
|
var TimePicker_default = TimePicker;
|
|
7308
7348
|
|
|
7309
7349
|
// src/components/Toast/Toast.tsx
|
|
7310
|
-
import
|
|
7350
|
+
import React42 from "react";
|
|
7311
7351
|
import { createPortal as createPortal3 } from "react-dom";
|
|
7312
7352
|
import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
7313
|
-
var ToastContext =
|
|
7353
|
+
var ToastContext = React42.createContext(null);
|
|
7314
7354
|
var useToast = () => {
|
|
7315
|
-
const ctx =
|
|
7355
|
+
const ctx = React42.useContext(ToastContext);
|
|
7316
7356
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
7317
7357
|
return ctx;
|
|
7318
7358
|
};
|
|
7319
7359
|
var EXIT_DURATION = 300;
|
|
7320
7360
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
7321
|
-
const ref =
|
|
7322
|
-
const [height, setHeight] =
|
|
7323
|
-
|
|
7361
|
+
const ref = React42.useRef(null);
|
|
7362
|
+
const [height, setHeight] = React42.useState(void 0);
|
|
7363
|
+
React42.useEffect(() => {
|
|
7324
7364
|
if (ref.current && !isExiting) {
|
|
7325
7365
|
setHeight(ref.current.offsetHeight);
|
|
7326
7366
|
}
|
|
@@ -7352,13 +7392,13 @@ var ToastProvider = ({
|
|
|
7352
7392
|
children,
|
|
7353
7393
|
position = "top-right"
|
|
7354
7394
|
}) => {
|
|
7355
|
-
const [toasts, setToasts] =
|
|
7356
|
-
const [removing, setRemoving] =
|
|
7357
|
-
const [mounted, setMounted] =
|
|
7358
|
-
|
|
7395
|
+
const [toasts, setToasts] = React42.useState([]);
|
|
7396
|
+
const [removing, setRemoving] = React42.useState(/* @__PURE__ */ new Set());
|
|
7397
|
+
const [mounted, setMounted] = React42.useState(false);
|
|
7398
|
+
React42.useEffect(() => {
|
|
7359
7399
|
setMounted(true);
|
|
7360
7400
|
}, []);
|
|
7361
|
-
const remove =
|
|
7401
|
+
const remove = React42.useCallback((id) => {
|
|
7362
7402
|
setRemoving((prev) => new Set(prev).add(id));
|
|
7363
7403
|
setTimeout(() => {
|
|
7364
7404
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -7369,7 +7409,7 @@ var ToastProvider = ({
|
|
|
7369
7409
|
});
|
|
7370
7410
|
}, EXIT_DURATION);
|
|
7371
7411
|
}, []);
|
|
7372
|
-
const toast =
|
|
7412
|
+
const toast = React42.useCallback(
|
|
7373
7413
|
(type, message, duration = 3e3) => {
|
|
7374
7414
|
const id = `${Date.now()}-${Math.random()}`;
|
|
7375
7415
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -7422,7 +7462,7 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
7422
7462
|
var ToggleChip_default = ToggleChip;
|
|
7423
7463
|
|
|
7424
7464
|
// src/components/Tooltip/Tooltip.tsx
|
|
7425
|
-
import
|
|
7465
|
+
import React43 from "react";
|
|
7426
7466
|
import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
|
|
7427
7467
|
var OFFSET = 12;
|
|
7428
7468
|
var GAP = 8;
|
|
@@ -7438,14 +7478,14 @@ var Tooltip = (props) => {
|
|
|
7438
7478
|
disabled = false
|
|
7439
7479
|
} = props;
|
|
7440
7480
|
const shape = variant ?? type ?? "dark";
|
|
7441
|
-
const triggerRef =
|
|
7442
|
-
const tooltipRef =
|
|
7443
|
-
const [visible, setVisible] =
|
|
7444
|
-
const [pos, setPos] =
|
|
7445
|
-
const delayTimer =
|
|
7446
|
-
const rafRef =
|
|
7447
|
-
const cursor =
|
|
7448
|
-
const clamp =
|
|
7481
|
+
const triggerRef = React43.useRef(null);
|
|
7482
|
+
const tooltipRef = React43.useRef(null);
|
|
7483
|
+
const [visible, setVisible] = React43.useState(false);
|
|
7484
|
+
const [pos, setPos] = React43.useState({ left: 0, top: 0 });
|
|
7485
|
+
const delayTimer = React43.useRef(0);
|
|
7486
|
+
const rafRef = React43.useRef(0);
|
|
7487
|
+
const cursor = React43.useRef(null);
|
|
7488
|
+
const clamp = React43.useCallback((left, top, w, h) => {
|
|
7449
7489
|
const vw = window.innerWidth;
|
|
7450
7490
|
const vh = window.innerHeight;
|
|
7451
7491
|
return {
|
|
@@ -7453,7 +7493,7 @@ var Tooltip = (props) => {
|
|
|
7453
7493
|
top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
|
|
7454
7494
|
};
|
|
7455
7495
|
}, []);
|
|
7456
|
-
const placeAtCursor =
|
|
7496
|
+
const placeAtCursor = React43.useCallback((x, y) => {
|
|
7457
7497
|
const el = tooltipRef.current;
|
|
7458
7498
|
if (!el) return;
|
|
7459
7499
|
const w = el.offsetWidth;
|
|
@@ -7464,7 +7504,7 @@ var Tooltip = (props) => {
|
|
|
7464
7504
|
if (top < GAP) top = y + OFFSET;
|
|
7465
7505
|
setPos(clamp(left, top, w, h));
|
|
7466
7506
|
}, [clamp]);
|
|
7467
|
-
const placeAtTrigger =
|
|
7507
|
+
const placeAtTrigger = React43.useCallback(() => {
|
|
7468
7508
|
const el = tooltipRef.current;
|
|
7469
7509
|
const trigger = triggerRef.current;
|
|
7470
7510
|
if (!el || !trigger) return;
|
|
@@ -7476,19 +7516,19 @@ var Tooltip = (props) => {
|
|
|
7476
7516
|
const left = rect.left + rect.width / 2 - w / 2;
|
|
7477
7517
|
setPos(clamp(left, top, w, h));
|
|
7478
7518
|
}, [clamp]);
|
|
7479
|
-
const reposition =
|
|
7519
|
+
const reposition = React43.useCallback(() => {
|
|
7480
7520
|
if (follow && cursor.current) {
|
|
7481
7521
|
placeAtCursor(cursor.current.x, cursor.current.y);
|
|
7482
7522
|
} else {
|
|
7483
7523
|
placeAtTrigger();
|
|
7484
7524
|
}
|
|
7485
7525
|
}, [follow, placeAtCursor, placeAtTrigger]);
|
|
7486
|
-
const handleMouseEnter =
|
|
7526
|
+
const handleMouseEnter = React43.useCallback((e) => {
|
|
7487
7527
|
if (disabled) return;
|
|
7488
7528
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
7489
7529
|
delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
|
|
7490
7530
|
}, [disabled]);
|
|
7491
|
-
const handleMouseMove =
|
|
7531
|
+
const handleMouseMove = React43.useCallback((e) => {
|
|
7492
7532
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
7493
7533
|
if (!visible || !follow) return;
|
|
7494
7534
|
cancelAnimationFrame(rafRef.current);
|
|
@@ -7496,25 +7536,25 @@ var Tooltip = (props) => {
|
|
|
7496
7536
|
if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
|
|
7497
7537
|
});
|
|
7498
7538
|
}, [visible, follow, placeAtCursor]);
|
|
7499
|
-
const close =
|
|
7539
|
+
const close = React43.useCallback(() => {
|
|
7500
7540
|
window.clearTimeout(delayTimer.current);
|
|
7501
7541
|
cancelAnimationFrame(rafRef.current);
|
|
7502
7542
|
setVisible(false);
|
|
7503
7543
|
}, []);
|
|
7504
|
-
const handleMouseLeave =
|
|
7544
|
+
const handleMouseLeave = React43.useCallback(() => {
|
|
7505
7545
|
cursor.current = null;
|
|
7506
7546
|
close();
|
|
7507
7547
|
}, [close]);
|
|
7508
|
-
const handleFocus =
|
|
7548
|
+
const handleFocus = React43.useCallback(() => {
|
|
7509
7549
|
if (disabled) return;
|
|
7510
7550
|
cursor.current = null;
|
|
7511
7551
|
setVisible(true);
|
|
7512
7552
|
}, [disabled]);
|
|
7513
|
-
|
|
7553
|
+
React43.useLayoutEffect(() => {
|
|
7514
7554
|
if (!visible) return;
|
|
7515
7555
|
reposition();
|
|
7516
7556
|
}, [visible, reposition]);
|
|
7517
|
-
|
|
7557
|
+
React43.useEffect(() => {
|
|
7518
7558
|
if (!visible || follow) return;
|
|
7519
7559
|
const onChange = () => placeAtTrigger();
|
|
7520
7560
|
window.addEventListener("scroll", onChange, true);
|
|
@@ -7524,7 +7564,7 @@ var Tooltip = (props) => {
|
|
|
7524
7564
|
window.removeEventListener("resize", onChange);
|
|
7525
7565
|
};
|
|
7526
7566
|
}, [visible, follow, placeAtTrigger]);
|
|
7527
|
-
|
|
7567
|
+
React43.useEffect(() => () => {
|
|
7528
7568
|
window.clearTimeout(delayTimer.current);
|
|
7529
7569
|
cancelAnimationFrame(rafRef.current);
|
|
7530
7570
|
}, []);
|
|
@@ -7563,7 +7603,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
7563
7603
|
var Tooltip_default = Tooltip;
|
|
7564
7604
|
|
|
7565
7605
|
// src/components/Video/Video.tsx
|
|
7566
|
-
import
|
|
7606
|
+
import React44 from "react";
|
|
7567
7607
|
import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
|
|
7568
7608
|
var PipIcon = () => /* @__PURE__ */ jsxs225("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
7569
7609
|
/* @__PURE__ */ jsx355("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
@@ -7575,7 +7615,7 @@ var formatTime = (sec) => {
|
|
|
7575
7615
|
const s = Math.floor(sec % 60);
|
|
7576
7616
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
7577
7617
|
};
|
|
7578
|
-
var Video =
|
|
7618
|
+
var Video = React44.forwardRef((props, ref) => {
|
|
7579
7619
|
const {
|
|
7580
7620
|
src,
|
|
7581
7621
|
poster,
|
|
@@ -7599,21 +7639,21 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
7599
7639
|
children,
|
|
7600
7640
|
...rest
|
|
7601
7641
|
} = props;
|
|
7602
|
-
const containerRef =
|
|
7603
|
-
const videoRef =
|
|
7604
|
-
const [isPlaying, setIsPlaying] =
|
|
7605
|
-
const [isLoaded, setIsLoaded] =
|
|
7606
|
-
const [currentTime, setCurrentTime] =
|
|
7607
|
-
const [duration, setDuration] =
|
|
7608
|
-
const [buffered, setBuffered] =
|
|
7609
|
-
const [volume, setVolume] =
|
|
7610
|
-
const [isMuted, setIsMuted] =
|
|
7611
|
-
const [isFullscreen, setIsFullscreen] =
|
|
7612
|
-
const [playbackRate, setPlaybackRate] =
|
|
7613
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
7614
|
-
const [captionsOn, setCaptionsOn] =
|
|
7615
|
-
const [isPip, setIsPip] =
|
|
7616
|
-
const setRefs =
|
|
7642
|
+
const containerRef = React44.useRef(null);
|
|
7643
|
+
const videoRef = React44.useRef(null);
|
|
7644
|
+
const [isPlaying, setIsPlaying] = React44.useState(Boolean(autoPlay));
|
|
7645
|
+
const [isLoaded, setIsLoaded] = React44.useState(false);
|
|
7646
|
+
const [currentTime, setCurrentTime] = React44.useState(0);
|
|
7647
|
+
const [duration, setDuration] = React44.useState(0);
|
|
7648
|
+
const [buffered, setBuffered] = React44.useState(0);
|
|
7649
|
+
const [volume, setVolume] = React44.useState(1);
|
|
7650
|
+
const [isMuted, setIsMuted] = React44.useState(Boolean(muted));
|
|
7651
|
+
const [isFullscreen, setIsFullscreen] = React44.useState(false);
|
|
7652
|
+
const [playbackRate, setPlaybackRate] = React44.useState(1);
|
|
7653
|
+
const [rateMenuOpen, setRateMenuOpen] = React44.useState(false);
|
|
7654
|
+
const [captionsOn, setCaptionsOn] = React44.useState(false);
|
|
7655
|
+
const [isPip, setIsPip] = React44.useState(false);
|
|
7656
|
+
const setRefs = React44.useCallback(
|
|
7617
7657
|
(el) => {
|
|
7618
7658
|
videoRef.current = el;
|
|
7619
7659
|
if (typeof ref === "function") ref(el);
|
|
@@ -7621,14 +7661,14 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
7621
7661
|
},
|
|
7622
7662
|
[ref]
|
|
7623
7663
|
);
|
|
7624
|
-
|
|
7664
|
+
React44.useEffect(() => {
|
|
7625
7665
|
const onFsChange = () => {
|
|
7626
7666
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
7627
7667
|
};
|
|
7628
7668
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
7629
7669
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
7630
7670
|
}, []);
|
|
7631
|
-
|
|
7671
|
+
React44.useEffect(() => {
|
|
7632
7672
|
const v = videoRef.current;
|
|
7633
7673
|
if (!v) return;
|
|
7634
7674
|
const onEnter = () => setIsPip(true);
|