@x-plat/design-system 0.14.19 → 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 +44 -16
- package/dist/components/Dropdown/index.js +44 -16
- package/dist/components/PopOver/index.cjs +43 -15
- package/dist/components/PopOver/index.js +43 -15
- package/dist/components/Select/index.cjs +63 -35
- package/dist/components/Select/index.js +63 -35
- package/dist/components/TimePicker/index.cjs +48 -20
- package/dist/components/TimePicker/index.js +48 -20
- package/dist/components/Tooltip/index.cjs +2 -2
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/index.cjs +245 -214
- package/dist/components/index.js +245 -214
- package/dist/index.cjs +250 -219
- package/dist/index.js +250 -219
- package/package.json +1 -1
|
@@ -3333,8 +3333,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
3333
3333
|
);
|
|
3334
3334
|
if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
|
|
3335
3335
|
const maxHeight = frozenMaxRef.current;
|
|
3336
|
-
|
|
3337
|
-
pop.style.
|
|
3336
|
+
const hostRect = (pop.offsetParent ?? pop.parentElement)?.getBoundingClientRect();
|
|
3337
|
+
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
3338
|
+
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
3338
3339
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
3339
3340
|
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";
|
|
3340
3341
|
directionRef.current = next;
|
|
@@ -4136,13 +4137,13 @@ Drawer.displayName = "Drawer";
|
|
|
4136
4137
|
var Drawer_default = Drawer;
|
|
4137
4138
|
|
|
4138
4139
|
// src/components/Dropdown/Dropdown.tsx
|
|
4139
|
-
var
|
|
4140
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
4140
4141
|
|
|
4141
4142
|
// src/tokens/hooks/Portal.tsx
|
|
4142
4143
|
var import_react_dom3 = __toESM(require("react-dom"), 1);
|
|
4143
|
-
var Portal = ({ children }) => {
|
|
4144
|
+
var Portal = ({ children, container }) => {
|
|
4144
4145
|
if (typeof document === "undefined") return null;
|
|
4145
|
-
return import_react_dom3.default.createPortal(children, document.body);
|
|
4146
|
+
return import_react_dom3.default.createPortal(children, container ?? document.body);
|
|
4146
4147
|
};
|
|
4147
4148
|
Portal.displayName = "Portal";
|
|
4148
4149
|
var Portal_default = Portal;
|
|
@@ -4172,15 +4173,42 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
4172
4173
|
};
|
|
4173
4174
|
var useClickOutside_default = useClickOutside;
|
|
4174
4175
|
|
|
4176
|
+
// src/tokens/hooks/useOverlayHost.ts
|
|
4177
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
4178
|
+
var useOverlayHost = (triggerRef, enabled) => {
|
|
4179
|
+
const [host, setHost] = import_react21.default.useState(null);
|
|
4180
|
+
import_react21.default.useLayoutEffect(() => {
|
|
4181
|
+
if (!enabled || !triggerRef.current) {
|
|
4182
|
+
setHost(null);
|
|
4183
|
+
return;
|
|
4184
|
+
}
|
|
4185
|
+
const el = document.createElement("div");
|
|
4186
|
+
el.dataset.xplatOverlayHost = "";
|
|
4187
|
+
el.style.position = "relative";
|
|
4188
|
+
el.style.width = "0";
|
|
4189
|
+
el.style.height = "0";
|
|
4190
|
+
const parent = findScrollParent(triggerRef.current) ?? document.body;
|
|
4191
|
+
parent.appendChild(el);
|
|
4192
|
+
setHost(el);
|
|
4193
|
+
return () => {
|
|
4194
|
+
el.remove();
|
|
4195
|
+
setHost(null);
|
|
4196
|
+
};
|
|
4197
|
+
}, [enabled, triggerRef]);
|
|
4198
|
+
return host;
|
|
4199
|
+
};
|
|
4200
|
+
var useOverlayHost_default = useOverlayHost;
|
|
4201
|
+
|
|
4175
4202
|
// src/components/Dropdown/Dropdown.tsx
|
|
4176
4203
|
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
4177
4204
|
var Dropdown = (props) => {
|
|
4178
4205
|
const { items, children } = props;
|
|
4179
|
-
const [isOpen, setIsOpen] =
|
|
4180
|
-
const [mounted, setMounted] =
|
|
4181
|
-
const [visible, setVisible] =
|
|
4182
|
-
const triggerRef =
|
|
4183
|
-
const menuRef =
|
|
4206
|
+
const [isOpen, setIsOpen] = import_react22.default.useState(false);
|
|
4207
|
+
const [mounted, setMounted] = import_react22.default.useState(false);
|
|
4208
|
+
const [visible, setVisible] = import_react22.default.useState(false);
|
|
4209
|
+
const triggerRef = import_react22.default.useRef(null);
|
|
4210
|
+
const menuRef = import_react22.default.useRef(null);
|
|
4211
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
4184
4212
|
useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
4185
4213
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
4186
4214
|
useCloseWhenFocusHidden(isOpen, triggerRef, menuRef, () => setIsOpen(false));
|
|
@@ -4188,7 +4216,7 @@ var Dropdown = (props) => {
|
|
|
4188
4216
|
setIsOpen(false);
|
|
4189
4217
|
triggerRef.current?.focus({ preventScroll: true });
|
|
4190
4218
|
});
|
|
4191
|
-
|
|
4219
|
+
import_react22.default.useEffect(() => {
|
|
4192
4220
|
if (isOpen) {
|
|
4193
4221
|
setMounted(true);
|
|
4194
4222
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -4213,7 +4241,7 @@ var Dropdown = (props) => {
|
|
|
4213
4241
|
children
|
|
4214
4242
|
}
|
|
4215
4243
|
),
|
|
4216
|
-
mounted && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
4244
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Portal_default, { container: host, children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
4217
4245
|
"div",
|
|
4218
4246
|
{
|
|
4219
4247
|
ref: menuRef,
|
|
@@ -4241,7 +4269,7 @@ Dropdown.displayName = "Dropdown";
|
|
|
4241
4269
|
var Dropdown_default = Dropdown;
|
|
4242
4270
|
|
|
4243
4271
|
// src/components/Editor/Editor.tsx
|
|
4244
|
-
var
|
|
4272
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
4245
4273
|
|
|
4246
4274
|
// src/components/Editor/highlight.ts
|
|
4247
4275
|
var CODE_LANGUAGES = [
|
|
@@ -4512,22 +4540,22 @@ var Editor = (props) => {
|
|
|
4512
4540
|
onImageUpload,
|
|
4513
4541
|
minHeight = 200
|
|
4514
4542
|
} = props;
|
|
4515
|
-
const editorRef =
|
|
4516
|
-
const lastRangeRef =
|
|
4517
|
-
const composingRef =
|
|
4518
|
-
const [isFocused, setIsFocused] =
|
|
4519
|
-
const [isEmpty, setIsEmpty] =
|
|
4520
|
-
const [activeFormats, setActiveFormats] =
|
|
4521
|
-
const [slashOpen, setSlashOpen] =
|
|
4522
|
-
const [slashFilter, setSlashFilter] =
|
|
4523
|
-
const [slashIdx, setSlashIdx] =
|
|
4524
|
-
const [slashPos, setSlashPos] =
|
|
4525
|
-
const slashStartRangeRef =
|
|
4526
|
-
const [linkOpen, setLinkOpen] =
|
|
4527
|
-
const [linkValue, setLinkValue] =
|
|
4528
|
-
const [linkPos, setLinkPos] =
|
|
4529
|
-
const lastEmittedRef =
|
|
4530
|
-
|
|
4543
|
+
const editorRef = import_react23.default.useRef(null);
|
|
4544
|
+
const lastRangeRef = import_react23.default.useRef(null);
|
|
4545
|
+
const composingRef = import_react23.default.useRef(false);
|
|
4546
|
+
const [isFocused, setIsFocused] = import_react23.default.useState(false);
|
|
4547
|
+
const [isEmpty, setIsEmpty] = import_react23.default.useState(!value);
|
|
4548
|
+
const [activeFormats, setActiveFormats] = import_react23.default.useState(/* @__PURE__ */ new Set());
|
|
4549
|
+
const [slashOpen, setSlashOpen] = import_react23.default.useState(false);
|
|
4550
|
+
const [slashFilter, setSlashFilter] = import_react23.default.useState("");
|
|
4551
|
+
const [slashIdx, setSlashIdx] = import_react23.default.useState(0);
|
|
4552
|
+
const [slashPos, setSlashPos] = import_react23.default.useState({ top: 0, left: 0 });
|
|
4553
|
+
const slashStartRangeRef = import_react23.default.useRef(null);
|
|
4554
|
+
const [linkOpen, setLinkOpen] = import_react23.default.useState(false);
|
|
4555
|
+
const [linkValue, setLinkValue] = import_react23.default.useState("");
|
|
4556
|
+
const [linkPos, setLinkPos] = import_react23.default.useState({ top: 0, left: 0 });
|
|
4557
|
+
const lastEmittedRef = import_react23.default.useRef(null);
|
|
4558
|
+
import_react23.default.useEffect(() => {
|
|
4531
4559
|
const el = editorRef.current;
|
|
4532
4560
|
if (!el) return;
|
|
4533
4561
|
if (value === lastEmittedRef.current) return;
|
|
@@ -4609,10 +4637,10 @@ var Editor = (props) => {
|
|
|
4609
4637
|
const current = String(document.queryCommandValue("formatBlock") || "").toLowerCase();
|
|
4610
4638
|
setBlock(current === tag ? "p" : tag);
|
|
4611
4639
|
};
|
|
4612
|
-
const historyRef =
|
|
4613
|
-
const historyIdxRef =
|
|
4614
|
-
const lastPushAtRef =
|
|
4615
|
-
const isRestoringRef =
|
|
4640
|
+
const historyRef = import_react23.default.useRef([]);
|
|
4641
|
+
const historyIdxRef = import_react23.default.useRef(-1);
|
|
4642
|
+
const lastPushAtRef = import_react23.default.useRef(0);
|
|
4643
|
+
const isRestoringRef = import_react23.default.useRef(false);
|
|
4616
4644
|
const caretOffset = (rootEl) => {
|
|
4617
4645
|
const el = rootEl ?? editorRef.current;
|
|
4618
4646
|
const sel = window.getSelection();
|
|
@@ -4689,8 +4717,8 @@ var Editor = (props) => {
|
|
|
4689
4717
|
const cls = Array.from(pre.classList).find((c) => c.startsWith("lang-"));
|
|
4690
4718
|
return cls?.slice(5) ?? "plain";
|
|
4691
4719
|
};
|
|
4692
|
-
const [codeLang, setCodeLang] =
|
|
4693
|
-
const highlightRafRef =
|
|
4720
|
+
const [codeLang, setCodeLang] = import_react23.default.useState("plain");
|
|
4721
|
+
const highlightRafRef = import_react23.default.useRef(0);
|
|
4694
4722
|
const rehighlight = (pre) => {
|
|
4695
4723
|
if (composingRef.current) return;
|
|
4696
4724
|
const code = pre.querySelector("code");
|
|
@@ -5035,7 +5063,7 @@ var Editor = (props) => {
|
|
|
5035
5063
|
setSlashIdx(0);
|
|
5036
5064
|
slashStartRangeRef.current = null;
|
|
5037
5065
|
};
|
|
5038
|
-
const filteredSlashItems =
|
|
5066
|
+
const filteredSlashItems = import_react23.default.useMemo(() => {
|
|
5039
5067
|
if (!slashFilter) return SLASH_ITEMS;
|
|
5040
5068
|
const f = slashFilter.toLowerCase();
|
|
5041
5069
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -5300,7 +5328,7 @@ var Editor = (props) => {
|
|
|
5300
5328
|
}
|
|
5301
5329
|
}
|
|
5302
5330
|
};
|
|
5303
|
-
const plainPasteRef =
|
|
5331
|
+
const plainPasteRef = import_react23.default.useRef(false);
|
|
5304
5332
|
const handlePaste = (e) => {
|
|
5305
5333
|
if (readOnly) return;
|
|
5306
5334
|
e.preventDefault();
|
|
@@ -5601,7 +5629,7 @@ var EditorToolbar = ({
|
|
|
5601
5629
|
] });
|
|
5602
5630
|
};
|
|
5603
5631
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
5604
|
-
|
|
5632
|
+
import_react23.default.useEffect(() => {
|
|
5605
5633
|
const handleClickOutside = (e) => {
|
|
5606
5634
|
const target = e.target;
|
|
5607
5635
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -5635,8 +5663,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
5635
5663
|
);
|
|
5636
5664
|
};
|
|
5637
5665
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
5638
|
-
const inputRef =
|
|
5639
|
-
|
|
5666
|
+
const inputRef = import_react23.default.useRef(null);
|
|
5667
|
+
import_react23.default.useEffect(() => {
|
|
5640
5668
|
inputRef.current?.focus();
|
|
5641
5669
|
}, []);
|
|
5642
5670
|
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
@@ -5694,7 +5722,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
5694
5722
|
var EmptyState_default = EmptyState;
|
|
5695
5723
|
|
|
5696
5724
|
// src/components/FileUpload/FileUpload.tsx
|
|
5697
|
-
var
|
|
5725
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
5698
5726
|
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
5699
5727
|
var FileUpload = (props) => {
|
|
5700
5728
|
const {
|
|
@@ -5708,9 +5736,9 @@ var FileUpload = (props) => {
|
|
|
5708
5736
|
label,
|
|
5709
5737
|
required
|
|
5710
5738
|
} = props;
|
|
5711
|
-
const fieldId =
|
|
5712
|
-
const [isDragOver, setIsDragOver] =
|
|
5713
|
-
const inputRef =
|
|
5739
|
+
const fieldId = import_react24.default.useId();
|
|
5740
|
+
const [isDragOver, setIsDragOver] = import_react24.default.useState(false);
|
|
5741
|
+
const inputRef = import_react24.default.useRef(null);
|
|
5714
5742
|
const handleFiles = (fileList) => {
|
|
5715
5743
|
let files = Array.from(fileList);
|
|
5716
5744
|
if (maxSize) {
|
|
@@ -5773,10 +5801,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
5773
5801
|
var FileUpload_default = FileUpload;
|
|
5774
5802
|
|
|
5775
5803
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
5776
|
-
var
|
|
5804
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
5777
5805
|
|
|
5778
5806
|
// src/components/HtmlTypeWriter/utils.ts
|
|
5779
|
-
var
|
|
5807
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
5780
5808
|
var voidTags = /* @__PURE__ */ new Set([
|
|
5781
5809
|
"br",
|
|
5782
5810
|
"img",
|
|
@@ -5844,15 +5872,15 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
5844
5872
|
props[attr.name] = attr.value;
|
|
5845
5873
|
});
|
|
5846
5874
|
if (voidTags.has(tag)) {
|
|
5847
|
-
return
|
|
5875
|
+
return import_react25.default.createElement(tag, props);
|
|
5848
5876
|
}
|
|
5849
5877
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
5850
|
-
return
|
|
5878
|
+
return import_react25.default.createElement(tag, props, ...children);
|
|
5851
5879
|
};
|
|
5852
5880
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
5853
5881
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
5854
5882
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
5855
|
-
return node == null ? null :
|
|
5883
|
+
return node == null ? null : import_react25.default.createElement(import_react25.default.Fragment, { key: idx }, node);
|
|
5856
5884
|
}).filter(Boolean);
|
|
5857
5885
|
return nodes.length === 0 ? null : nodes;
|
|
5858
5886
|
};
|
|
@@ -5865,20 +5893,20 @@ var HtmlTypeWriter = ({
|
|
|
5865
5893
|
onDone,
|
|
5866
5894
|
onChange
|
|
5867
5895
|
}) => {
|
|
5868
|
-
const [typedLen, setTypedLen] =
|
|
5869
|
-
const doneCalledRef =
|
|
5870
|
-
const { doc, rangeMap, totalLength } =
|
|
5896
|
+
const [typedLen, setTypedLen] = import_react26.default.useState(0);
|
|
5897
|
+
const doneCalledRef = import_react26.default.useRef(false);
|
|
5898
|
+
const { doc, rangeMap, totalLength } = import_react26.default.useMemo(() => {
|
|
5871
5899
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
5872
5900
|
const decoded = decodeHtmlEntities(html);
|
|
5873
5901
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
5874
5902
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
5875
5903
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
5876
5904
|
}, [html]);
|
|
5877
|
-
|
|
5905
|
+
import_react26.default.useEffect(() => {
|
|
5878
5906
|
setTypedLen(0);
|
|
5879
5907
|
doneCalledRef.current = false;
|
|
5880
5908
|
}, [html]);
|
|
5881
|
-
|
|
5909
|
+
import_react26.default.useEffect(() => {
|
|
5882
5910
|
if (!totalLength) return;
|
|
5883
5911
|
if (typedLen >= totalLength) return;
|
|
5884
5912
|
const timer = window.setInterval(() => {
|
|
@@ -5886,18 +5914,18 @@ var HtmlTypeWriter = ({
|
|
|
5886
5914
|
}, duration);
|
|
5887
5915
|
return () => window.clearInterval(timer);
|
|
5888
5916
|
}, [typedLen, totalLength, duration]);
|
|
5889
|
-
|
|
5917
|
+
import_react26.default.useEffect(() => {
|
|
5890
5918
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
5891
5919
|
onChange?.();
|
|
5892
5920
|
}
|
|
5893
5921
|
}, [typedLen, totalLength, onChange]);
|
|
5894
|
-
|
|
5922
|
+
import_react26.default.useEffect(() => {
|
|
5895
5923
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
5896
5924
|
doneCalledRef.current = true;
|
|
5897
5925
|
onDone?.();
|
|
5898
5926
|
}
|
|
5899
5927
|
}, [typedLen, totalLength, onDone]);
|
|
5900
|
-
const parsed =
|
|
5928
|
+
const parsed = import_react26.default.useMemo(
|
|
5901
5929
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
5902
5930
|
[doc, typedLen, rangeMap]
|
|
5903
5931
|
);
|
|
@@ -5907,13 +5935,13 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
|
5907
5935
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
5908
5936
|
|
|
5909
5937
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
5910
|
-
var
|
|
5938
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
5911
5939
|
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
5912
5940
|
var ImageSelector = (props) => {
|
|
5913
5941
|
const { value, placeholder, onChange, validations, label, required } = props;
|
|
5914
|
-
const fieldId =
|
|
5915
|
-
const [previewUrl, setPreviewUrl] =
|
|
5916
|
-
|
|
5942
|
+
const fieldId = import_react27.default.useId();
|
|
5943
|
+
const [previewUrl, setPreviewUrl] = import_react27.default.useState();
|
|
5944
|
+
import_react27.default.useEffect(() => {
|
|
5917
5945
|
if (!value) {
|
|
5918
5946
|
setPreviewUrl(void 0);
|
|
5919
5947
|
return;
|
|
@@ -5922,7 +5950,7 @@ var ImageSelector = (props) => {
|
|
|
5922
5950
|
setPreviewUrl(url);
|
|
5923
5951
|
return () => URL.revokeObjectURL(url);
|
|
5924
5952
|
}, [value]);
|
|
5925
|
-
const inputRef =
|
|
5953
|
+
const inputRef = import_react27.default.useRef(null);
|
|
5926
5954
|
const handleFileChange = (e) => {
|
|
5927
5955
|
const selectedFile = e.target.files?.[0];
|
|
5928
5956
|
if (selectedFile) {
|
|
@@ -6105,22 +6133,23 @@ Pagination.displayName = "Pagination";
|
|
|
6105
6133
|
var Pagination_default = Pagination;
|
|
6106
6134
|
|
|
6107
6135
|
// src/components/PopOver/PopOver.tsx
|
|
6108
|
-
var
|
|
6136
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
6109
6137
|
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
6110
6138
|
var PopOver = (props) => {
|
|
6111
6139
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
6112
|
-
const popRef =
|
|
6113
|
-
const triggerRef =
|
|
6114
|
-
const [localOpen, setLocalOpen] =
|
|
6115
|
-
const [eventTrigger, setEventTrigger] =
|
|
6140
|
+
const popRef = import_react28.default.useRef(null);
|
|
6141
|
+
const triggerRef = import_react28.default.useRef(null);
|
|
6142
|
+
const [localOpen, setLocalOpen] = import_react28.default.useState(false);
|
|
6143
|
+
const [eventTrigger, setEventTrigger] = import_react28.default.useState(false);
|
|
6116
6144
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
6117
6145
|
useCloseWhenFocusHidden(isOpen, triggerRef, popRef, onClose);
|
|
6118
6146
|
useEscapeKey(isOpen, () => {
|
|
6119
6147
|
onClose();
|
|
6120
6148
|
triggerRef.current?.focus({ preventScroll: true });
|
|
6121
6149
|
});
|
|
6150
|
+
const host = useOverlayHost_default(triggerRef, localOpen);
|
|
6122
6151
|
useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
6123
|
-
|
|
6152
|
+
import_react28.default.useEffect(() => {
|
|
6124
6153
|
if (isOpen) {
|
|
6125
6154
|
setLocalOpen(isOpen);
|
|
6126
6155
|
setTimeout(() => {
|
|
@@ -6143,7 +6172,7 @@ var PopOver = (props) => {
|
|
|
6143
6172
|
},
|
|
6144
6173
|
children: [
|
|
6145
6174
|
children,
|
|
6146
|
-
localOpen && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
6175
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(Portal_default, { container: host, children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
6147
6176
|
"div",
|
|
6148
6177
|
{
|
|
6149
6178
|
className: clsx_default(
|
|
@@ -6201,12 +6230,12 @@ Progress.displayName = "Progress";
|
|
|
6201
6230
|
var Progress_default = Progress;
|
|
6202
6231
|
|
|
6203
6232
|
// src/components/Radio/RadioGroupContext.tsx
|
|
6204
|
-
var
|
|
6205
|
-
var RadioGroupContext =
|
|
6233
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
6234
|
+
var RadioGroupContext = import_react29.default.createContext(
|
|
6206
6235
|
null
|
|
6207
6236
|
);
|
|
6208
6237
|
var useRadioGroupContext = () => {
|
|
6209
|
-
return
|
|
6238
|
+
return import_react29.default.useContext(RadioGroupContext);
|
|
6210
6239
|
};
|
|
6211
6240
|
var RadioGroupContext_default = RadioGroupContext;
|
|
6212
6241
|
|
|
@@ -6282,19 +6311,19 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
6282
6311
|
var RadioGroup_default = RadioGroup;
|
|
6283
6312
|
|
|
6284
6313
|
// src/components/Select/Select.tsx
|
|
6285
|
-
var
|
|
6314
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
6286
6315
|
|
|
6287
6316
|
// src/components/Select/context.ts
|
|
6288
|
-
var
|
|
6289
|
-
var SelectContext =
|
|
6317
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
6318
|
+
var SelectContext = import_react30.default.createContext(null);
|
|
6290
6319
|
var context_default = SelectContext;
|
|
6291
6320
|
|
|
6292
6321
|
// src/components/Select/SelectItem.tsx
|
|
6293
|
-
var
|
|
6322
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
6294
6323
|
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
6295
6324
|
var SelectItem = (props) => {
|
|
6296
6325
|
const { children, value, onClick, disabled = false } = props;
|
|
6297
|
-
const ctx =
|
|
6326
|
+
const ctx = import_react31.default.useContext(context_default);
|
|
6298
6327
|
const handleClick = (e) => {
|
|
6299
6328
|
e.preventDefault();
|
|
6300
6329
|
e.stopPropagation();
|
|
@@ -6344,29 +6373,29 @@ var SelectRoot = (props) => {
|
|
|
6344
6373
|
required,
|
|
6345
6374
|
size = "md"
|
|
6346
6375
|
} = props;
|
|
6347
|
-
const fieldId =
|
|
6348
|
-
const itemChildren =
|
|
6349
|
-
(child) =>
|
|
6376
|
+
const fieldId = import_react32.default.useId();
|
|
6377
|
+
const itemChildren = import_react32.default.Children.toArray(children).filter(
|
|
6378
|
+
(child) => import_react32.default.isValidElement(child) && child.type === SelectItem_default
|
|
6350
6379
|
);
|
|
6351
6380
|
const isControlled = valueProp !== void 0;
|
|
6352
|
-
const [isOpen, setOpen] =
|
|
6353
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
6354
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
6355
|
-
const controlledLabel =
|
|
6381
|
+
const [isOpen, setOpen] = import_react32.default.useState(false);
|
|
6382
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react32.default.useState(null);
|
|
6383
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react32.default.useState(void 0);
|
|
6384
|
+
const controlledLabel = import_react32.default.useMemo(() => {
|
|
6356
6385
|
if (!isControlled) return null;
|
|
6357
6386
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
6358
6387
|
return match ? match.props.children : null;
|
|
6359
6388
|
}, [isControlled, valueProp, itemChildren]);
|
|
6360
6389
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
6361
6390
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
6362
|
-
const triggerRef =
|
|
6363
|
-
const contentRef =
|
|
6364
|
-
const [mounted, setMounted] =
|
|
6365
|
-
const [visible, setVisible] =
|
|
6366
|
-
|
|
6391
|
+
const triggerRef = import_react32.default.useRef(null);
|
|
6392
|
+
const contentRef = import_react32.default.useRef(null);
|
|
6393
|
+
const [mounted, setMounted] = import_react32.default.useState(false);
|
|
6394
|
+
const [visible, setVisible] = import_react32.default.useState(false);
|
|
6395
|
+
import_react32.default.useEffect(() => {
|
|
6367
6396
|
if (disabled && isOpen) setOpen(false);
|
|
6368
6397
|
}, [disabled, isOpen]);
|
|
6369
|
-
|
|
6398
|
+
import_react32.default.useEffect(() => {
|
|
6370
6399
|
if (isOpen) {
|
|
6371
6400
|
setMounted(true);
|
|
6372
6401
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -6376,33 +6405,34 @@ var SelectRoot = (props) => {
|
|
|
6376
6405
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
6377
6406
|
return () => clearTimeout(t);
|
|
6378
6407
|
}, [isOpen]);
|
|
6379
|
-
const [query, setQuery] =
|
|
6408
|
+
const [query, setQuery] = import_react32.default.useState("");
|
|
6380
6409
|
const textOf = (node) => {
|
|
6381
6410
|
if (node === null || node === void 0 || typeof node === "boolean") return "";
|
|
6382
6411
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
6383
6412
|
if (Array.isArray(node)) return node.map(textOf).join("");
|
|
6384
|
-
if (
|
|
6413
|
+
if (import_react32.default.isValidElement(node)) return textOf(node.props.children);
|
|
6385
6414
|
return "";
|
|
6386
6415
|
};
|
|
6387
|
-
const visibleItems =
|
|
6416
|
+
const visibleItems = import_react32.default.useMemo(() => {
|
|
6388
6417
|
if (!searchable || !query.trim()) return itemChildren;
|
|
6389
6418
|
const q = query.trim().toLowerCase();
|
|
6390
6419
|
return itemChildren.filter((c) => textOf(c.props.children).toLowerCase().includes(q));
|
|
6391
6420
|
}, [searchable, query, itemChildren]);
|
|
6392
|
-
const open =
|
|
6393
|
-
const close =
|
|
6421
|
+
const open = import_react32.default.useCallback(() => setOpen(true), []);
|
|
6422
|
+
const close = import_react32.default.useCallback(() => {
|
|
6394
6423
|
setOpen(false);
|
|
6395
6424
|
setQuery("");
|
|
6396
6425
|
}, []);
|
|
6397
|
-
const toggle =
|
|
6426
|
+
const toggle = import_react32.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
6398
6427
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
6399
6428
|
useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
|
|
6400
6429
|
useEscapeKey(isOpen, () => {
|
|
6401
6430
|
close();
|
|
6402
6431
|
triggerRef.current?.focus({ preventScroll: true });
|
|
6403
6432
|
});
|
|
6433
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
6404
6434
|
useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
6405
|
-
const setSelected =
|
|
6435
|
+
const setSelected = import_react32.default.useCallback(
|
|
6406
6436
|
(label2, itemValue) => {
|
|
6407
6437
|
if (!isControlled) {
|
|
6408
6438
|
setUncontrolledLabel(label2);
|
|
@@ -6412,7 +6442,7 @@ var SelectRoot = (props) => {
|
|
|
6412
6442
|
},
|
|
6413
6443
|
[isControlled, onChange]
|
|
6414
6444
|
);
|
|
6415
|
-
const ctxValue =
|
|
6445
|
+
const ctxValue = import_react32.default.useMemo(
|
|
6416
6446
|
() => ({
|
|
6417
6447
|
isOpen,
|
|
6418
6448
|
mounted,
|
|
@@ -6491,7 +6521,7 @@ var SelectRoot = (props) => {
|
|
|
6491
6521
|
]
|
|
6492
6522
|
}
|
|
6493
6523
|
),
|
|
6494
|
-
mounted && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
6524
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(Portal_default, { container: host, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
6495
6525
|
"div",
|
|
6496
6526
|
{
|
|
6497
6527
|
className: clsx_default("lib-xplat-select-content", size, stateClass),
|
|
@@ -6657,7 +6687,7 @@ Steps.displayName = "Steps";
|
|
|
6657
6687
|
var Steps_default = Steps;
|
|
6658
6688
|
|
|
6659
6689
|
// src/components/Swiper/Swiper.tsx
|
|
6660
|
-
var
|
|
6690
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
6661
6691
|
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
6662
6692
|
var Swiper = (props) => {
|
|
6663
6693
|
const {
|
|
@@ -6682,26 +6712,26 @@ var Swiper = (props) => {
|
|
|
6682
6712
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
6683
6713
|
const useLoop = loop && canSlide;
|
|
6684
6714
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
6685
|
-
const extendedItems =
|
|
6715
|
+
const extendedItems = import_react33.default.useMemo(() => {
|
|
6686
6716
|
if (!useLoop) return items;
|
|
6687
6717
|
return [...items, ...items, ...items];
|
|
6688
6718
|
}, [items, useLoop]);
|
|
6689
6719
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
6690
|
-
const [innerIndex, setInnerIndex] =
|
|
6720
|
+
const [innerIndex, setInnerIndex] = import_react33.default.useState(
|
|
6691
6721
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
6692
6722
|
);
|
|
6693
|
-
const [isDragging, setIsDragging] =
|
|
6694
|
-
const [dragOffset, setDragOffset] =
|
|
6695
|
-
const [animated, setAnimated] =
|
|
6696
|
-
const [containerWidth, setContainerWidth] =
|
|
6697
|
-
const containerRef =
|
|
6698
|
-
const startXRef =
|
|
6699
|
-
const startTimeRef =
|
|
6700
|
-
const autoplayTimerRef =
|
|
6701
|
-
const resumeTimeoutRef =
|
|
6702
|
-
const [paused, setPaused] =
|
|
6703
|
-
const initializedRef =
|
|
6704
|
-
|
|
6723
|
+
const [isDragging, setIsDragging] = import_react33.default.useState(false);
|
|
6724
|
+
const [dragOffset, setDragOffset] = import_react33.default.useState(0);
|
|
6725
|
+
const [animated, setAnimated] = import_react33.default.useState(false);
|
|
6726
|
+
const [containerWidth, setContainerWidth] = import_react33.default.useState(0);
|
|
6727
|
+
const containerRef = import_react33.default.useRef(null);
|
|
6728
|
+
const startXRef = import_react33.default.useRef(0);
|
|
6729
|
+
const startTimeRef = import_react33.default.useRef(0);
|
|
6730
|
+
const autoplayTimerRef = import_react33.default.useRef(null);
|
|
6731
|
+
const resumeTimeoutRef = import_react33.default.useRef(null);
|
|
6732
|
+
const [paused, setPaused] = import_react33.default.useState(false);
|
|
6733
|
+
const initializedRef = import_react33.default.useRef(false);
|
|
6734
|
+
import_react33.default.useEffect(() => {
|
|
6705
6735
|
const el = containerRef.current;
|
|
6706
6736
|
if (!el) return;
|
|
6707
6737
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -6724,7 +6754,7 @@ var Swiper = (props) => {
|
|
|
6724
6754
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
6725
6755
|
};
|
|
6726
6756
|
const realIndex = getRealIndex(innerIndex);
|
|
6727
|
-
const moveToInner =
|
|
6757
|
+
const moveToInner = import_react33.default.useCallback(
|
|
6728
6758
|
(idx, withAnim = true) => {
|
|
6729
6759
|
if (!useLoop) {
|
|
6730
6760
|
setAnimated(withAnim);
|
|
@@ -6752,7 +6782,7 @@ var Swiper = (props) => {
|
|
|
6752
6782
|
},
|
|
6753
6783
|
[useLoop, cloneCount, totalSlides]
|
|
6754
6784
|
);
|
|
6755
|
-
const handleTransitionEnd =
|
|
6785
|
+
const handleTransitionEnd = import_react33.default.useCallback(() => {
|
|
6756
6786
|
if (!useLoop) return;
|
|
6757
6787
|
const real = getRealIndex(innerIndex);
|
|
6758
6788
|
const canonical = cloneCount + real;
|
|
@@ -6762,7 +6792,7 @@ var Swiper = (props) => {
|
|
|
6762
6792
|
}
|
|
6763
6793
|
onChange?.(Math.min(real, maxIndex));
|
|
6764
6794
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
6765
|
-
const slideTo =
|
|
6795
|
+
const slideTo = import_react33.default.useCallback(
|
|
6766
6796
|
(logicalIndex) => {
|
|
6767
6797
|
if (!canSlide) return;
|
|
6768
6798
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -6772,7 +6802,7 @@ var Swiper = (props) => {
|
|
|
6772
6802
|
},
|
|
6773
6803
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
6774
6804
|
);
|
|
6775
|
-
const slideNext =
|
|
6805
|
+
const slideNext = import_react33.default.useCallback(() => {
|
|
6776
6806
|
if (!canSlide) return;
|
|
6777
6807
|
const nextInner = innerIndex + slideBy;
|
|
6778
6808
|
if (useLoop) {
|
|
@@ -6781,7 +6811,7 @@ var Swiper = (props) => {
|
|
|
6781
6811
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
6782
6812
|
}
|
|
6783
6813
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
6784
|
-
const slidePrev =
|
|
6814
|
+
const slidePrev = import_react33.default.useCallback(() => {
|
|
6785
6815
|
if (!canSlide) return;
|
|
6786
6816
|
const prevInner = innerIndex - slideBy;
|
|
6787
6817
|
if (useLoop) {
|
|
@@ -6790,7 +6820,7 @@ var Swiper = (props) => {
|
|
|
6790
6820
|
moveToInner(Math.max(prevInner, 0), true);
|
|
6791
6821
|
}
|
|
6792
6822
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
6793
|
-
|
|
6823
|
+
import_react33.default.useEffect(() => {
|
|
6794
6824
|
if (indexProp === void 0) return;
|
|
6795
6825
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
6796
6826
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -6798,12 +6828,12 @@ var Swiper = (props) => {
|
|
|
6798
6828
|
moveToInner(target, true);
|
|
6799
6829
|
}
|
|
6800
6830
|
}, [indexProp]);
|
|
6801
|
-
|
|
6831
|
+
import_react33.default.useImperativeHandle(swiperRef, () => ({
|
|
6802
6832
|
slidePrev,
|
|
6803
6833
|
slideNext,
|
|
6804
6834
|
slideTo
|
|
6805
6835
|
}));
|
|
6806
|
-
|
|
6836
|
+
import_react33.default.useEffect(() => {
|
|
6807
6837
|
if (!auto || !canSlide || paused) return;
|
|
6808
6838
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
6809
6839
|
return () => {
|
|
@@ -6829,7 +6859,7 @@ var Swiper = (props) => {
|
|
|
6829
6859
|
resumeTimeoutRef.current = null;
|
|
6830
6860
|
}, pauseOnInteraction);
|
|
6831
6861
|
};
|
|
6832
|
-
|
|
6862
|
+
import_react33.default.useEffect(() => {
|
|
6833
6863
|
return () => {
|
|
6834
6864
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
6835
6865
|
};
|
|
@@ -6847,7 +6877,7 @@ var Swiper = (props) => {
|
|
|
6847
6877
|
startXRef.current = getClientX(e);
|
|
6848
6878
|
startTimeRef.current = Date.now();
|
|
6849
6879
|
};
|
|
6850
|
-
|
|
6880
|
+
import_react33.default.useEffect(() => {
|
|
6851
6881
|
if (!isDragging) return;
|
|
6852
6882
|
const handleMove = (e) => {
|
|
6853
6883
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -6886,7 +6916,7 @@ var Swiper = (props) => {
|
|
|
6886
6916
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
6887
6917
|
const slideWidthPercent = 100 / viewItemCount;
|
|
6888
6918
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
6889
|
-
const slideElements =
|
|
6919
|
+
const slideElements = import_react33.default.useMemo(
|
|
6890
6920
|
() => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
6891
6921
|
"div",
|
|
6892
6922
|
{
|
|
@@ -6960,7 +6990,7 @@ Swiper.displayName = "Swiper";
|
|
|
6960
6990
|
var Swiper_default = Swiper;
|
|
6961
6991
|
|
|
6962
6992
|
// src/components/Switch/Switch.tsx
|
|
6963
|
-
var
|
|
6993
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
6964
6994
|
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
6965
6995
|
var KNOB_TRANSITION_MS = 250;
|
|
6966
6996
|
var Switch = (props) => {
|
|
@@ -6974,11 +7004,11 @@ var Switch = (props) => {
|
|
|
6974
7004
|
label,
|
|
6975
7005
|
required
|
|
6976
7006
|
} = props;
|
|
6977
|
-
const fieldId =
|
|
7007
|
+
const fieldId = import_react34.default.useId();
|
|
6978
7008
|
const statusType = normalizeStatus(type);
|
|
6979
|
-
const [isAnimating, setIsAnimating] =
|
|
6980
|
-
const timeoutRef =
|
|
6981
|
-
|
|
7009
|
+
const [isAnimating, setIsAnimating] = import_react34.default.useState(false);
|
|
7010
|
+
const timeoutRef = import_react34.default.useRef(null);
|
|
7011
|
+
import_react34.default.useEffect(() => {
|
|
6982
7012
|
return () => {
|
|
6983
7013
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6984
7014
|
};
|
|
@@ -7017,10 +7047,10 @@ Switch.displayName = "Switch";
|
|
|
7017
7047
|
var Switch_default = Switch;
|
|
7018
7048
|
|
|
7019
7049
|
// src/components/Table/TableContext.tsx
|
|
7020
|
-
var
|
|
7021
|
-
var TableContext =
|
|
7050
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
7051
|
+
var TableContext = import_react35.default.createContext(null);
|
|
7022
7052
|
var useTableContext = () => {
|
|
7023
|
-
const ctx =
|
|
7053
|
+
const ctx = import_react35.default.useContext(TableContext);
|
|
7024
7054
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
7025
7055
|
return ctx;
|
|
7026
7056
|
};
|
|
@@ -7063,24 +7093,24 @@ TableBody.displayName = "TableBody";
|
|
|
7063
7093
|
var TableBody_default = TableBody;
|
|
7064
7094
|
|
|
7065
7095
|
// src/components/Table/TableCell.tsx
|
|
7066
|
-
var
|
|
7096
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
7067
7097
|
|
|
7068
7098
|
// src/components/Table/TableHeadContext.tsx
|
|
7069
|
-
var
|
|
7070
|
-
var TableHeadContext =
|
|
7099
|
+
var import_react36 = __toESM(require("react"), 1);
|
|
7100
|
+
var TableHeadContext = import_react36.default.createContext(
|
|
7071
7101
|
null
|
|
7072
7102
|
);
|
|
7073
7103
|
var useTableHeadContext = () => {
|
|
7074
|
-
const ctx =
|
|
7104
|
+
const ctx = import_react36.default.useContext(TableHeadContext);
|
|
7075
7105
|
return ctx;
|
|
7076
7106
|
};
|
|
7077
7107
|
var TableHeadContext_default = TableHeadContext;
|
|
7078
7108
|
|
|
7079
7109
|
// src/components/Table/TableRowContext.tsx
|
|
7080
|
-
var
|
|
7081
|
-
var TableRowContext =
|
|
7110
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
7111
|
+
var TableRowContext = import_react37.default.createContext(null);
|
|
7082
7112
|
var useTableRowContext = () => {
|
|
7083
|
-
const ctx =
|
|
7113
|
+
const ctx = import_react37.default.useContext(TableRowContext);
|
|
7084
7114
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
7085
7115
|
return ctx;
|
|
7086
7116
|
};
|
|
@@ -7088,7 +7118,7 @@ var TableRowContext_default = TableRowContext;
|
|
|
7088
7118
|
|
|
7089
7119
|
// src/components/Table/TableCell.tsx
|
|
7090
7120
|
var import_jsx_runtime346 = require("react/jsx-runtime");
|
|
7091
|
-
var TableCell =
|
|
7121
|
+
var TableCell = import_react38.default.memo((props) => {
|
|
7092
7122
|
const {
|
|
7093
7123
|
children,
|
|
7094
7124
|
align = "center",
|
|
@@ -7102,9 +7132,9 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
7102
7132
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
7103
7133
|
const { stickyShadow } = useTableContext();
|
|
7104
7134
|
const headContext = useTableHeadContext();
|
|
7105
|
-
const [left, setLeft] =
|
|
7106
|
-
const cellRef =
|
|
7107
|
-
const calculateLeft =
|
|
7135
|
+
const [left, setLeft] = import_react38.default.useState(0);
|
|
7136
|
+
const cellRef = import_react38.default.useRef(null);
|
|
7137
|
+
const calculateLeft = import_react38.default.useCallback(() => {
|
|
7108
7138
|
if (!cellRef.current) return 0;
|
|
7109
7139
|
let totalLeft = 0;
|
|
7110
7140
|
for (const ref of stickyCells) {
|
|
@@ -7113,7 +7143,7 @@ var TableCell = import_react37.default.memo((props) => {
|
|
|
7113
7143
|
}
|
|
7114
7144
|
return totalLeft;
|
|
7115
7145
|
}, [stickyCells]);
|
|
7116
|
-
|
|
7146
|
+
import_react38.default.useEffect(() => {
|
|
7117
7147
|
if (!isSticky || !cellRef.current) return;
|
|
7118
7148
|
registerStickyCell(cellRef);
|
|
7119
7149
|
setLeft(calculateLeft());
|
|
@@ -7171,9 +7201,9 @@ TableHead.displayName = "TableHead";
|
|
|
7171
7201
|
var TableHead_default = TableHead;
|
|
7172
7202
|
|
|
7173
7203
|
// src/components/Table/TableRow.tsx
|
|
7174
|
-
var
|
|
7204
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
7175
7205
|
var import_jsx_runtime348 = require("react/jsx-runtime");
|
|
7176
|
-
var TableRow =
|
|
7206
|
+
var TableRow = import_react39.default.memo((props) => {
|
|
7177
7207
|
const {
|
|
7178
7208
|
children,
|
|
7179
7209
|
type = "secondary",
|
|
@@ -7182,7 +7212,7 @@ var TableRow = import_react38.default.memo((props) => {
|
|
|
7182
7212
|
onClick
|
|
7183
7213
|
} = props;
|
|
7184
7214
|
const { rowBorderUse } = useTableContext();
|
|
7185
|
-
const [stickyCells, setStickyCells] =
|
|
7215
|
+
const [stickyCells, setStickyCells] = import_react39.default.useState([]);
|
|
7186
7216
|
const registerStickyCell = (ref) => {
|
|
7187
7217
|
setStickyCells((prev) => {
|
|
7188
7218
|
if (prev.includes(ref)) return prev;
|
|
@@ -7246,9 +7276,9 @@ Tag.displayName = "Tag";
|
|
|
7246
7276
|
var Tag_default = Tag;
|
|
7247
7277
|
|
|
7248
7278
|
// src/components/TextArea/TextArea.tsx
|
|
7249
|
-
var
|
|
7279
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
7250
7280
|
var import_jsx_runtime350 = require("react/jsx-runtime");
|
|
7251
|
-
var TextArea =
|
|
7281
|
+
var TextArea = import_react40.default.forwardRef(
|
|
7252
7282
|
(props, ref) => {
|
|
7253
7283
|
const {
|
|
7254
7284
|
className,
|
|
@@ -7261,7 +7291,7 @@ var TextArea = import_react39.default.forwardRef(
|
|
|
7261
7291
|
disabled,
|
|
7262
7292
|
...textareaProps
|
|
7263
7293
|
} = props;
|
|
7264
|
-
const autoId =
|
|
7294
|
+
const autoId = import_react40.default.useId();
|
|
7265
7295
|
const fieldId = props.id ?? autoId;
|
|
7266
7296
|
const control = /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
7267
7297
|
"textarea",
|
|
@@ -7283,7 +7313,7 @@ TextArea.displayName = "TextArea";
|
|
|
7283
7313
|
var TextArea_default = TextArea;
|
|
7284
7314
|
|
|
7285
7315
|
// src/components/TimePicker/TimePicker.tsx
|
|
7286
|
-
var
|
|
7316
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
7287
7317
|
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
7288
7318
|
var ANIMATION_DURATION_MS4 = 200;
|
|
7289
7319
|
var toMinutes = (hhmm) => {
|
|
@@ -7321,13 +7351,13 @@ var TimePicker = (props) => {
|
|
|
7321
7351
|
required,
|
|
7322
7352
|
validations
|
|
7323
7353
|
} = props;
|
|
7324
|
-
const fieldId =
|
|
7325
|
-
const triggerRef =
|
|
7326
|
-
const contentRef =
|
|
7327
|
-
const [isOpen, setOpen] =
|
|
7328
|
-
const [mounted, setMounted] =
|
|
7329
|
-
const [visible, setVisible] =
|
|
7330
|
-
const options =
|
|
7354
|
+
const fieldId = import_react41.default.useId();
|
|
7355
|
+
const triggerRef = import_react41.default.useRef(null);
|
|
7356
|
+
const contentRef = import_react41.default.useRef(null);
|
|
7357
|
+
const [isOpen, setOpen] = import_react41.default.useState(false);
|
|
7358
|
+
const [mounted, setMounted] = import_react41.default.useState(false);
|
|
7359
|
+
const [visible, setVisible] = import_react41.default.useState(false);
|
|
7360
|
+
const options = import_react41.default.useMemo(() => {
|
|
7331
7361
|
const safeStep = step > 0 && step <= 720 ? step : 30;
|
|
7332
7362
|
const lo = toMinutes(min) ?? 0;
|
|
7333
7363
|
const hi = toMinutes(max) ?? 24 * 60 - 1;
|
|
@@ -7335,18 +7365,19 @@ var TimePicker = (props) => {
|
|
|
7335
7365
|
for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
|
|
7336
7366
|
return out;
|
|
7337
7367
|
}, [step, min, max]);
|
|
7338
|
-
const close =
|
|
7368
|
+
const close = import_react41.default.useCallback(() => setOpen(false), []);
|
|
7339
7369
|
useClickOutside_default([triggerRef, contentRef], close, isOpen);
|
|
7340
7370
|
useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
|
|
7341
7371
|
useEscapeKey(isOpen, () => {
|
|
7342
7372
|
close();
|
|
7343
7373
|
triggerRef.current?.focus({ preventScroll: true });
|
|
7344
7374
|
});
|
|
7375
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
7345
7376
|
useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
7346
|
-
|
|
7377
|
+
import_react41.default.useEffect(() => {
|
|
7347
7378
|
if (disabled && isOpen) setOpen(false);
|
|
7348
7379
|
}, [disabled, isOpen]);
|
|
7349
|
-
|
|
7380
|
+
import_react41.default.useEffect(() => {
|
|
7350
7381
|
if (isOpen) {
|
|
7351
7382
|
setMounted(true);
|
|
7352
7383
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -7384,7 +7415,7 @@ var TimePicker = (props) => {
|
|
|
7384
7415
|
children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)("span", { className: clsx_default("time-picker-value", !value && "placeholder"), children: value ? display(value, use12Hours) : placeholder })
|
|
7385
7416
|
}
|
|
7386
7417
|
),
|
|
7387
|
-
mounted && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
|
|
7418
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(Portal_default, { container: host, children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
|
|
7388
7419
|
"div",
|
|
7389
7420
|
{
|
|
7390
7421
|
ref: contentRef,
|
|
@@ -7418,20 +7449,20 @@ TimePicker.displayName = "TimePicker";
|
|
|
7418
7449
|
var TimePicker_default = TimePicker;
|
|
7419
7450
|
|
|
7420
7451
|
// src/components/Toast/Toast.tsx
|
|
7421
|
-
var
|
|
7452
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
7422
7453
|
var import_react_dom4 = require("react-dom");
|
|
7423
7454
|
var import_jsx_runtime352 = require("react/jsx-runtime");
|
|
7424
|
-
var ToastContext =
|
|
7455
|
+
var ToastContext = import_react42.default.createContext(null);
|
|
7425
7456
|
var useToast = () => {
|
|
7426
|
-
const ctx =
|
|
7457
|
+
const ctx = import_react42.default.useContext(ToastContext);
|
|
7427
7458
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
7428
7459
|
return ctx;
|
|
7429
7460
|
};
|
|
7430
7461
|
var EXIT_DURATION = 300;
|
|
7431
7462
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
7432
|
-
const ref =
|
|
7433
|
-
const [height, setHeight] =
|
|
7434
|
-
|
|
7463
|
+
const ref = import_react42.default.useRef(null);
|
|
7464
|
+
const [height, setHeight] = import_react42.default.useState(void 0);
|
|
7465
|
+
import_react42.default.useEffect(() => {
|
|
7435
7466
|
if (ref.current && !isExiting) {
|
|
7436
7467
|
setHeight(ref.current.offsetHeight);
|
|
7437
7468
|
}
|
|
@@ -7463,13 +7494,13 @@ var ToastProvider = ({
|
|
|
7463
7494
|
children,
|
|
7464
7495
|
position = "top-right"
|
|
7465
7496
|
}) => {
|
|
7466
|
-
const [toasts, setToasts] =
|
|
7467
|
-
const [removing, setRemoving] =
|
|
7468
|
-
const [mounted, setMounted] =
|
|
7469
|
-
|
|
7497
|
+
const [toasts, setToasts] = import_react42.default.useState([]);
|
|
7498
|
+
const [removing, setRemoving] = import_react42.default.useState(/* @__PURE__ */ new Set());
|
|
7499
|
+
const [mounted, setMounted] = import_react42.default.useState(false);
|
|
7500
|
+
import_react42.default.useEffect(() => {
|
|
7470
7501
|
setMounted(true);
|
|
7471
7502
|
}, []);
|
|
7472
|
-
const remove =
|
|
7503
|
+
const remove = import_react42.default.useCallback((id) => {
|
|
7473
7504
|
setRemoving((prev) => new Set(prev).add(id));
|
|
7474
7505
|
setTimeout(() => {
|
|
7475
7506
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -7480,7 +7511,7 @@ var ToastProvider = ({
|
|
|
7480
7511
|
});
|
|
7481
7512
|
}, EXIT_DURATION);
|
|
7482
7513
|
}, []);
|
|
7483
|
-
const toast =
|
|
7514
|
+
const toast = import_react42.default.useCallback(
|
|
7484
7515
|
(type, message, duration = 3e3) => {
|
|
7485
7516
|
const id = `${Date.now()}-${Math.random()}`;
|
|
7486
7517
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -7533,7 +7564,7 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
7533
7564
|
var ToggleChip_default = ToggleChip;
|
|
7534
7565
|
|
|
7535
7566
|
// src/components/Tooltip/Tooltip.tsx
|
|
7536
|
-
var
|
|
7567
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
7537
7568
|
var import_jsx_runtime354 = require("react/jsx-runtime");
|
|
7538
7569
|
var OFFSET = 12;
|
|
7539
7570
|
var GAP = 8;
|
|
@@ -7549,14 +7580,14 @@ var Tooltip = (props) => {
|
|
|
7549
7580
|
disabled = false
|
|
7550
7581
|
} = props;
|
|
7551
7582
|
const shape = variant ?? type ?? "dark";
|
|
7552
|
-
const triggerRef =
|
|
7553
|
-
const tooltipRef =
|
|
7554
|
-
const [visible, setVisible] =
|
|
7555
|
-
const [pos, setPos] =
|
|
7556
|
-
const delayTimer =
|
|
7557
|
-
const rafRef =
|
|
7558
|
-
const cursor =
|
|
7559
|
-
const clamp =
|
|
7583
|
+
const triggerRef = import_react43.default.useRef(null);
|
|
7584
|
+
const tooltipRef = import_react43.default.useRef(null);
|
|
7585
|
+
const [visible, setVisible] = import_react43.default.useState(false);
|
|
7586
|
+
const [pos, setPos] = import_react43.default.useState({ left: 0, top: 0 });
|
|
7587
|
+
const delayTimer = import_react43.default.useRef(0);
|
|
7588
|
+
const rafRef = import_react43.default.useRef(0);
|
|
7589
|
+
const cursor = import_react43.default.useRef(null);
|
|
7590
|
+
const clamp = import_react43.default.useCallback((left, top, w, h) => {
|
|
7560
7591
|
const vw = window.innerWidth;
|
|
7561
7592
|
const vh = window.innerHeight;
|
|
7562
7593
|
return {
|
|
@@ -7564,7 +7595,7 @@ var Tooltip = (props) => {
|
|
|
7564
7595
|
top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
|
|
7565
7596
|
};
|
|
7566
7597
|
}, []);
|
|
7567
|
-
const placeAtCursor =
|
|
7598
|
+
const placeAtCursor = import_react43.default.useCallback((x, y) => {
|
|
7568
7599
|
const el = tooltipRef.current;
|
|
7569
7600
|
if (!el) return;
|
|
7570
7601
|
const w = el.offsetWidth;
|
|
@@ -7575,7 +7606,7 @@ var Tooltip = (props) => {
|
|
|
7575
7606
|
if (top < GAP) top = y + OFFSET;
|
|
7576
7607
|
setPos(clamp(left, top, w, h));
|
|
7577
7608
|
}, [clamp]);
|
|
7578
|
-
const placeAtTrigger =
|
|
7609
|
+
const placeAtTrigger = import_react43.default.useCallback(() => {
|
|
7579
7610
|
const el = tooltipRef.current;
|
|
7580
7611
|
const trigger = triggerRef.current;
|
|
7581
7612
|
if (!el || !trigger) return;
|
|
@@ -7587,19 +7618,19 @@ var Tooltip = (props) => {
|
|
|
7587
7618
|
const left = rect.left + rect.width / 2 - w / 2;
|
|
7588
7619
|
setPos(clamp(left, top, w, h));
|
|
7589
7620
|
}, [clamp]);
|
|
7590
|
-
const reposition =
|
|
7621
|
+
const reposition = import_react43.default.useCallback(() => {
|
|
7591
7622
|
if (follow && cursor.current) {
|
|
7592
7623
|
placeAtCursor(cursor.current.x, cursor.current.y);
|
|
7593
7624
|
} else {
|
|
7594
7625
|
placeAtTrigger();
|
|
7595
7626
|
}
|
|
7596
7627
|
}, [follow, placeAtCursor, placeAtTrigger]);
|
|
7597
|
-
const handleMouseEnter =
|
|
7628
|
+
const handleMouseEnter = import_react43.default.useCallback((e) => {
|
|
7598
7629
|
if (disabled) return;
|
|
7599
7630
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
7600
7631
|
delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
|
|
7601
7632
|
}, [disabled]);
|
|
7602
|
-
const handleMouseMove =
|
|
7633
|
+
const handleMouseMove = import_react43.default.useCallback((e) => {
|
|
7603
7634
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
7604
7635
|
if (!visible || !follow) return;
|
|
7605
7636
|
cancelAnimationFrame(rafRef.current);
|
|
@@ -7607,25 +7638,25 @@ var Tooltip = (props) => {
|
|
|
7607
7638
|
if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
|
|
7608
7639
|
});
|
|
7609
7640
|
}, [visible, follow, placeAtCursor]);
|
|
7610
|
-
const close =
|
|
7641
|
+
const close = import_react43.default.useCallback(() => {
|
|
7611
7642
|
window.clearTimeout(delayTimer.current);
|
|
7612
7643
|
cancelAnimationFrame(rafRef.current);
|
|
7613
7644
|
setVisible(false);
|
|
7614
7645
|
}, []);
|
|
7615
|
-
const handleMouseLeave =
|
|
7646
|
+
const handleMouseLeave = import_react43.default.useCallback(() => {
|
|
7616
7647
|
cursor.current = null;
|
|
7617
7648
|
close();
|
|
7618
7649
|
}, [close]);
|
|
7619
|
-
const handleFocus =
|
|
7650
|
+
const handleFocus = import_react43.default.useCallback(() => {
|
|
7620
7651
|
if (disabled) return;
|
|
7621
7652
|
cursor.current = null;
|
|
7622
7653
|
setVisible(true);
|
|
7623
7654
|
}, [disabled]);
|
|
7624
|
-
|
|
7655
|
+
import_react43.default.useLayoutEffect(() => {
|
|
7625
7656
|
if (!visible) return;
|
|
7626
7657
|
reposition();
|
|
7627
7658
|
}, [visible, reposition]);
|
|
7628
|
-
|
|
7659
|
+
import_react43.default.useEffect(() => {
|
|
7629
7660
|
if (!visible || follow) return;
|
|
7630
7661
|
const onChange = () => placeAtTrigger();
|
|
7631
7662
|
window.addEventListener("scroll", onChange, true);
|
|
@@ -7635,7 +7666,7 @@ var Tooltip = (props) => {
|
|
|
7635
7666
|
window.removeEventListener("resize", onChange);
|
|
7636
7667
|
};
|
|
7637
7668
|
}, [visible, follow, placeAtTrigger]);
|
|
7638
|
-
|
|
7669
|
+
import_react43.default.useEffect(() => () => {
|
|
7639
7670
|
window.clearTimeout(delayTimer.current);
|
|
7640
7671
|
cancelAnimationFrame(rafRef.current);
|
|
7641
7672
|
}, []);
|
|
@@ -7674,7 +7705,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
7674
7705
|
var Tooltip_default = Tooltip;
|
|
7675
7706
|
|
|
7676
7707
|
// src/components/Video/Video.tsx
|
|
7677
|
-
var
|
|
7708
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
7678
7709
|
var import_jsx_runtime355 = require("react/jsx-runtime");
|
|
7679
7710
|
var PipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
7680
7711
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsx)("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
@@ -7686,7 +7717,7 @@ var formatTime = (sec) => {
|
|
|
7686
7717
|
const s = Math.floor(sec % 60);
|
|
7687
7718
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
7688
7719
|
};
|
|
7689
|
-
var Video =
|
|
7720
|
+
var Video = import_react44.default.forwardRef((props, ref) => {
|
|
7690
7721
|
const {
|
|
7691
7722
|
src,
|
|
7692
7723
|
poster,
|
|
@@ -7710,21 +7741,21 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
7710
7741
|
children,
|
|
7711
7742
|
...rest
|
|
7712
7743
|
} = props;
|
|
7713
|
-
const containerRef =
|
|
7714
|
-
const videoRef =
|
|
7715
|
-
const [isPlaying, setIsPlaying] =
|
|
7716
|
-
const [isLoaded, setIsLoaded] =
|
|
7717
|
-
const [currentTime, setCurrentTime] =
|
|
7718
|
-
const [duration, setDuration] =
|
|
7719
|
-
const [buffered, setBuffered] =
|
|
7720
|
-
const [volume, setVolume] =
|
|
7721
|
-
const [isMuted, setIsMuted] =
|
|
7722
|
-
const [isFullscreen, setIsFullscreen] =
|
|
7723
|
-
const [playbackRate, setPlaybackRate] =
|
|
7724
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
7725
|
-
const [captionsOn, setCaptionsOn] =
|
|
7726
|
-
const [isPip, setIsPip] =
|
|
7727
|
-
const setRefs =
|
|
7744
|
+
const containerRef = import_react44.default.useRef(null);
|
|
7745
|
+
const videoRef = import_react44.default.useRef(null);
|
|
7746
|
+
const [isPlaying, setIsPlaying] = import_react44.default.useState(Boolean(autoPlay));
|
|
7747
|
+
const [isLoaded, setIsLoaded] = import_react44.default.useState(false);
|
|
7748
|
+
const [currentTime, setCurrentTime] = import_react44.default.useState(0);
|
|
7749
|
+
const [duration, setDuration] = import_react44.default.useState(0);
|
|
7750
|
+
const [buffered, setBuffered] = import_react44.default.useState(0);
|
|
7751
|
+
const [volume, setVolume] = import_react44.default.useState(1);
|
|
7752
|
+
const [isMuted, setIsMuted] = import_react44.default.useState(Boolean(muted));
|
|
7753
|
+
const [isFullscreen, setIsFullscreen] = import_react44.default.useState(false);
|
|
7754
|
+
const [playbackRate, setPlaybackRate] = import_react44.default.useState(1);
|
|
7755
|
+
const [rateMenuOpen, setRateMenuOpen] = import_react44.default.useState(false);
|
|
7756
|
+
const [captionsOn, setCaptionsOn] = import_react44.default.useState(false);
|
|
7757
|
+
const [isPip, setIsPip] = import_react44.default.useState(false);
|
|
7758
|
+
const setRefs = import_react44.default.useCallback(
|
|
7728
7759
|
(el) => {
|
|
7729
7760
|
videoRef.current = el;
|
|
7730
7761
|
if (typeof ref === "function") ref(el);
|
|
@@ -7732,14 +7763,14 @@ var Video = import_react43.default.forwardRef((props, ref) => {
|
|
|
7732
7763
|
},
|
|
7733
7764
|
[ref]
|
|
7734
7765
|
);
|
|
7735
|
-
|
|
7766
|
+
import_react44.default.useEffect(() => {
|
|
7736
7767
|
const onFsChange = () => {
|
|
7737
7768
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
7738
7769
|
};
|
|
7739
7770
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
7740
7771
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
7741
7772
|
}, []);
|
|
7742
|
-
|
|
7773
|
+
import_react44.default.useEffect(() => {
|
|
7743
7774
|
const v = videoRef.current;
|
|
7744
7775
|
if (!v) return;
|
|
7745
7776
|
const onEnter = () => setIsPip(true);
|