@unicom-cloud/ui 0.8.76 → 0.8.78
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/Affix.js +1 -1
- package/Alert.js +1 -1
- package/AutoComplete.js +3 -5
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +3 -3
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +6 -2
- package/Collapse.js +1 -1
- package/ColorPicker.js +3 -4
- package/Comment.js +1 -1
- package/ConfigProvider.js +2 -3
- package/Copy.js +1 -1
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +5 -6
- package/Mentions.js +3 -4
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +2 -2
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +5 -4
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Select.js +5 -6
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/SpeechSynthesis.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +15 -16
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +2 -2
- package/Transfer.js +3 -4
- package/Tree.js +2 -3
- package/TreeSelect.js +3 -3
- package/Trigger.js +1 -1
- package/Typography.js +3 -3
- package/affix/index.js +1 -1
- package/alert/index.js +1 -1
- package/anchor/Anchor.js +1 -1
- package/anchor/Link.js +1 -1
- package/auto-complete/index.js +13 -147
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +12 -318
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +4 -4
- package/cascader/index.js +1 -1
- package/cascader/util.js +8 -8
- package/checkbox/Checkbox.js +7 -4
- package/checkbox/Group.js +5 -5
- package/checkbox/GroupBlock.js +8 -0
- package/checkbox/index.js +7 -2
- package/chunk/{CqtaeJXT.js → 9TSjT7x_.js} +4 -4
- package/chunk/{DezXC21w.js → BC5fEyWK.js} +2 -1
- package/chunk/{ByRETFRI.js → BPQXH_5i.js} +32 -31
- package/chunk/{BPD5iNdA.js → CB4jGw4K.js} +22 -18
- package/chunk/{lf-xRLXx.js → CBgu99gQ.js} +1 -1
- package/chunk/CNcLypMY.js +723 -0
- package/chunk/{D9JpbqFT.js → C_4I3haT.js} +1 -1
- package/chunk/{DM_DBvmG.js → CjqvxJml.js} +2 -2
- package/chunk/Cwm8LL5p.js +7818 -0
- package/chunk/{BGmWsXl0.js → tpmioyz1.js} +1 -1
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +2 -2
- package/color-picker/InputRgb.js +2 -2
- package/color-picker/Palette.js +2 -2
- package/color-picker/Panel.js +15 -266
- package/color-picker/colors.js +1 -1
- package/color-picker/index.js +13 -268
- package/color-picker/utils.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +5 -8
- package/config-provider/context.js +1 -1
- package/config-provider/index.js +4 -5
- package/copy/index.js +1 -1
- package/date-picker/Picker.js +1 -1
- package/date-picker/PickerRange.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +30 -21
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +1 -1
- package/empty/index.js +1 -1
- package/form/Form.js +10 -10
- package/form/FormItem.js +1 -1
- package/grid/Col.js +1 -1
- package/grid/Row.js +1 -1
- package/grid/grid-item.js +1 -1
- package/grid/grid.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/useWindowSize.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/image/Image.js +2 -2
- package/image/ImagePreview.js +2 -2
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +399 -411
- package/input/Group.js +1 -1
- package/input/Input.js +1 -1
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +1 -1
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +17 -267
- package/mentions/index.js +11 -144
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +1 -1
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +5 -45
- package/pagination/Pagination.js +11 -243
- package/pagination/index.js +2 -2
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/index.js +1 -1
- package/radio/Group.js +5 -5
- package/radio/GroupBlock.js +9 -0
- package/radio/Radio.js +6 -5
- package/radio/index.js +4 -3
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +1 -1
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/index.js +1 -1
- package/select/Option.js +6 -93
- package/select/Select.js +23 -546
- package/select/index.js +3 -3
- package/select/util.js +18 -139
- package/select-view/Core.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +1 -1
- package/slider/index.js +1 -1
- package/space/index.js +1 -1
- package/speech-synthesis/index.js +1 -1
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/statistic/Countdown.js +1 -1
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style.css +1 -1
- package/switch/index.js +1 -1
- package/table/Table.js +2 -3
- package/table/index.js +15 -109
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +2 -2
- package/transfer/Item.js +9 -104
- package/transfer/List.js +13 -184
- package/transfer/index.js +13 -180
- package/tree/Animation.js +2 -2
- package/tree/Node.js +3 -4
- package/tree/NodeList.js +6 -80
- package/tree/Tree.js +17 -578
- package/tree/index.js +2 -3
- package/tree-select/List.js +6 -122
- package/tree-select/Select.js +22 -392
- package/tree-select/index.js +3 -3
- package/trigger/index.js +1 -1
- package/types/checkbox/Checkbox.d.ts +5 -2
- package/types/checkbox/GroupBlock.d.ts +7 -0
- package/types/checkbox/index.d.ts +2 -1
- package/types/config-provider/ConfigProvider.d.ts +0 -27
- package/types/config-provider/interface.d.ts +3 -1
- package/types/index.d.ts +2 -2
- package/types/menu/context.d.ts +1 -1
- package/types/radio/GroupBlock.d.ts +7 -0
- package/types/radio/Radio.d.ts +5 -3
- package/types/utils/index.d.ts +1 -0
- package/types/utils/setPrimaryColor.d.ts +2 -0
- package/typography/Base.js +1 -1
- package/typography/Ellipsis.js +8 -22
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/index.js +10 -277
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +1 -1
- package/upload/Uploader.js +43 -44
- package/utils/color.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/index.js +155 -153
- package/utils/setDarkTheme.js +21 -20
- package/utils/setPrimaryColor.js +26 -0
- package/utils/tinycolor.js +1 -1
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/chunk/CQzKdjhX.js +0 -714
- package/chunk/CzaoCNQH.js +0 -1020
- package/chunk/D0qXkqyq.js +0 -1820
- package/chunk/DQrLGkIG.js +0 -209
- package/chunk/J07pQqQ7.js +0 -310
- package/chunk/OPbfCome.js +0 -170
|
@@ -3,7 +3,7 @@ import ln from "@unicom-cloud/icons/IconUiClose";
|
|
|
3
3
|
import Ie from "lodash/isFunction";
|
|
4
4
|
import sn, { forwardRef as Oe, useState as $, useImperativeHandle as an, useRef as x, useContext as cn, useCallback as U, useEffect as oe } from "react";
|
|
5
5
|
import De from "../button/index.js";
|
|
6
|
-
import { b as Le, d as un, a as dn, I as mn } from "./
|
|
6
|
+
import { b as Le, d as un, a as dn, I as mn } from "./CNcLypMY.js";
|
|
7
7
|
import { u as fn } from "./oopARUrq.js";
|
|
8
8
|
import { u as pn } from "./BFTV6myl.js";
|
|
9
9
|
import { u as Cn } from "./DeV0v__J.js";
|
|
@@ -14,9 +14,9 @@ import { p as Be } from "./CUFsOxJ2.js";
|
|
|
14
14
|
import { contains as gn, isServerRendering as xn } from "../utils/dom.js";
|
|
15
15
|
import { o as kn } from "./BrOW642m.js";
|
|
16
16
|
import { o as vn } from "./BKKEev13.js";
|
|
17
|
-
import { f as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
17
|
+
import { f as Mn } from "./Cc_-i0o_.js";
|
|
18
|
+
import wn from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
19
|
+
import En from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
20
20
|
import Re from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
21
21
|
import Tn from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
22
22
|
import { createRoot as yn } from "react-dom/client";
|
|
@@ -35,13 +35,13 @@ const V = (n) => {
|
|
|
35
35
|
i = /* @__PURE__ */ s(Tn, {});
|
|
36
36
|
break;
|
|
37
37
|
case "success":
|
|
38
|
-
i = /* @__PURE__ */ s(
|
|
38
|
+
i = /* @__PURE__ */ s(wn, {});
|
|
39
39
|
break;
|
|
40
40
|
case "warning":
|
|
41
41
|
i = /* @__PURE__ */ s(Re, {});
|
|
42
42
|
break;
|
|
43
43
|
case "error":
|
|
44
|
-
i = /* @__PURE__ */ s(
|
|
44
|
+
i = /* @__PURE__ */ s(En, {});
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -57,7 +57,7 @@ function le(n, i) {
|
|
|
57
57
|
t.className = "pqb-modal-root", document.body.appendChild(t);
|
|
58
58
|
const m = Nn();
|
|
59
59
|
function k(a) {
|
|
60
|
-
const h = /* @__PURE__ */ s(Le, { ...m, children: /* @__PURE__ */ s(
|
|
60
|
+
const h = /* @__PURE__ */ s(Le, { ...m, childrenName: "ModalConfirm", children: /* @__PURE__ */ s(
|
|
61
61
|
Dn,
|
|
62
62
|
{
|
|
63
63
|
getPopupContainer: () => t,
|
|
@@ -247,12 +247,12 @@ const Ln = {
|
|
|
247
247
|
alignCenter: !0
|
|
248
248
|
};
|
|
249
249
|
function Xn(n, i) {
|
|
250
|
-
var
|
|
250
|
+
var we;
|
|
251
251
|
i || (i = x());
|
|
252
252
|
const u = cn(dn), t = pn(
|
|
253
253
|
n,
|
|
254
254
|
Ln,
|
|
255
|
-
(
|
|
255
|
+
(we = u.componentConfig) == null ? void 0 : we.Modal
|
|
256
256
|
), {
|
|
257
257
|
className: m,
|
|
258
258
|
style: k,
|
|
@@ -285,7 +285,7 @@ function Xn(n, i) {
|
|
|
285
285
|
closeIcon: ae,
|
|
286
286
|
fullscreenable: Yn,
|
|
287
287
|
...ce
|
|
288
|
-
} = t, B = x(null), ue = x(null),
|
|
288
|
+
} = t, B = x(null), ue = x(null), M = x(null), [de, me] = $(), [fe, ze] = $(), Y = x(null), R = x(!1), [qe, pe] = $(""), [Ce, he] = $("");
|
|
289
289
|
fn();
|
|
290
290
|
const A = x(!0);
|
|
291
291
|
l && A.current && (A.current = !1);
|
|
@@ -294,7 +294,7 @@ function Xn(n, i) {
|
|
|
294
294
|
const [We, K] = Cn(!1, {
|
|
295
295
|
defaultValue: !1,
|
|
296
296
|
value: Xe
|
|
297
|
-
}), d = u.getPrefixCls("modal", t.prefixCls), { locale: G, rtl: be } = u, Ze = !r || ce.noticeType === "show", je = "closable" in t ? t.closable : Ze, Ae = U(() =>
|
|
297
|
+
}), d = u.getPrefixCls("modal", t.prefixCls), { locale: G, rtl: be } = u, Ze = !r || ce.noticeType === "show", je = "closable" in t ? t.closable : Ze, Ae = U(() => Mn(f()), [f]);
|
|
298
298
|
hn(Ae, { hidden: l && X });
|
|
299
299
|
function J(e) {
|
|
300
300
|
e.stopPropagation(), Q();
|
|
@@ -337,7 +337,7 @@ function Xn(n, i) {
|
|
|
337
337
|
isNaN(o) || ze(o + 1);
|
|
338
338
|
}
|
|
339
339
|
}, _e = () => {
|
|
340
|
-
var g,
|
|
340
|
+
var g, w, E, I, S, y, N, Ee, Te, ye, Ne, Pe;
|
|
341
341
|
if (L === null)
|
|
342
342
|
return;
|
|
343
343
|
const e = ((g = t.cancelButton) == null ? void 0 : g.visible) !== !1 && /* @__PURE__ */ s(
|
|
@@ -345,8 +345,8 @@ function Xn(n, i) {
|
|
|
345
345
|
{
|
|
346
346
|
onClick: J,
|
|
347
347
|
...h,
|
|
348
|
-
...(
|
|
349
|
-
children: ((I = (
|
|
348
|
+
...(w = t.cancelButton) == null ? void 0 : w.props,
|
|
349
|
+
children: ((I = (E = t.cancelButton) == null ? void 0 : E.props) == null ? void 0 : I.children) || ((S = t.cancelButton) == null ? void 0 : S.label) || ((y = t.cancelButton) == null ? void 0 : y.text) || P || G.Modal.cancelText
|
|
350
350
|
}
|
|
351
351
|
), o = ((N = t.okButton) == null ? void 0 : N.visible) !== !1 && /* @__PURE__ */ s(
|
|
352
352
|
De,
|
|
@@ -355,7 +355,7 @@ function Xn(n, i) {
|
|
|
355
355
|
onClick: Je,
|
|
356
356
|
type: "primary",
|
|
357
357
|
...a,
|
|
358
|
-
...(
|
|
358
|
+
...(Ee = t.okButton) == null ? void 0 : Ee.props,
|
|
359
359
|
children: ((ye = (Te = t.okButton) == null ? void 0 : Te.props) == null ? void 0 : ye.children) || ((Ne = t.okButton) == null ? void 0 : Ne.label) || ((Pe = t.okButton) == null ? void 0 : Pe.text) || v || G.Modal.okText
|
|
360
360
|
}
|
|
361
361
|
), p = Ie(L) ? L(e, o) : L || /* @__PURE__ */ O(rn, { children: [
|
|
@@ -366,18 +366,18 @@ function Xn(n, i) {
|
|
|
366
366
|
}, ee = x(
|
|
367
367
|
ke()
|
|
368
368
|
), en = U((e) => {
|
|
369
|
-
var p, g,
|
|
370
|
-
if (!
|
|
369
|
+
var p, g, w, E, I;
|
|
370
|
+
if (!M.current) return;
|
|
371
371
|
e.preventDefault();
|
|
372
372
|
const o = ee.current;
|
|
373
|
-
o.screenX = e.screenX, o.screenY = e.screenY, o.prewTranslateX = o.translateX, o.prewTranslateY = o.translateY, o.boundingClientRect = ((g = (p =
|
|
373
|
+
o.screenX = e.screenX, o.screenY = e.screenY, o.prewTranslateX = o.translateX, o.prewTranslateY = o.translateY, o.boundingClientRect = ((g = (p = M.current) == null ? void 0 : p.getBoundingClientRect) == null ? void 0 : g.call(p)) ?? {}, o.offsetParentBoundingClientRect = ((I = (E = (w = M.current) == null ? void 0 : w.offsetParent) == null ? void 0 : E.getBoundingClientRect) == null ? void 0 : I.call(E)) ?? {}, H(), nn();
|
|
374
374
|
}, []), ge = U((e) => {
|
|
375
375
|
e.preventDefault();
|
|
376
|
-
const o = ee.current, { left: p, right: g, top:
|
|
376
|
+
const o = ee.current, { left: p, right: g, top: w, bottom: E } = o.boundingClientRect ?? {}, { width: I, height: S } = o.offsetParentBoundingClientRect ?? {};
|
|
377
377
|
let y = Math.max(e.screenX - o.screenX, -p);
|
|
378
378
|
y = Math.min(y, I - g);
|
|
379
|
-
let N = Math.max(e.screenY - o.screenY, -
|
|
380
|
-
N = Math.min(N, S -
|
|
379
|
+
let N = Math.max(e.screenY - o.screenY, -w);
|
|
380
|
+
N = Math.min(N, S - E), y += o.prewTranslateX, N += o.prewTranslateY, o.translateX = y, o.translateY = N, pe(`translate(${y}px, ${N}px)`);
|
|
381
381
|
}, []), xe = U((e) => {
|
|
382
382
|
e.preventDefault(), H();
|
|
383
383
|
}, []);
|
|
@@ -416,12 +416,13 @@ function Xn(n, i) {
|
|
|
416
416
|
}
|
|
417
417
|
oe(() => () => {
|
|
418
418
|
ne(), H();
|
|
419
|
-
}, []), oe(() => (
|
|
420
|
-
}), [
|
|
419
|
+
}, []), oe(() => (M.current || (ne(), H()), () => {
|
|
420
|
+
}), [M.current]);
|
|
421
421
|
const tn = /* @__PURE__ */ O(
|
|
422
422
|
Le,
|
|
423
423
|
{
|
|
424
424
|
...u,
|
|
425
|
+
childrenName: "Modal",
|
|
425
426
|
prefixCls: t.prefixCls || u.prefixCls,
|
|
426
427
|
locale: G,
|
|
427
428
|
zIndex: fe || 1050,
|
|
@@ -488,7 +489,7 @@ function Xn(n, i) {
|
|
|
488
489
|
transform: qe,
|
|
489
490
|
transformOrigin: Ce
|
|
490
491
|
},
|
|
491
|
-
ref:
|
|
492
|
+
ref: M,
|
|
492
493
|
children: tn
|
|
493
494
|
}
|
|
494
495
|
), te = (e) => {
|
|
@@ -496,16 +497,16 @@ function Xn(n, i) {
|
|
|
496
497
|
return;
|
|
497
498
|
let o = "";
|
|
498
499
|
if (Y.current) {
|
|
499
|
-
const p = e.getBoundingClientRect(), { left: g, top:
|
|
500
|
-
o = `${g - p.left}px ${
|
|
500
|
+
const p = e.getBoundingClientRect(), { left: g, top: w } = Y.current;
|
|
501
|
+
o = `${g - p.left}px ${w - p.top}px`;
|
|
501
502
|
}
|
|
502
503
|
he(o);
|
|
503
|
-
},
|
|
504
|
-
return l ||
|
|
504
|
+
}, Me = A.current ? !q : !!M.current;
|
|
505
|
+
return l || Me ? /* @__PURE__ */ s(
|
|
505
506
|
bn,
|
|
506
507
|
{
|
|
507
508
|
visible: l,
|
|
508
|
-
forceRender:
|
|
509
|
+
forceRender: Me,
|
|
509
510
|
getContainer: f,
|
|
510
511
|
children: /* @__PURE__ */ O(
|
|
511
512
|
"div",
|
|
@@ -587,7 +588,7 @@ function Xn(n, i) {
|
|
|
587
588
|
unmountOnExit: W,
|
|
588
589
|
mountOnEnter: q,
|
|
589
590
|
onEnter: (e) => {
|
|
590
|
-
e && (me(!0), Y.current = re, te(e),
|
|
591
|
+
e && (me(!0), Y.current = re, te(e), M.current = e);
|
|
591
592
|
},
|
|
592
593
|
onEntered: (e) => {
|
|
593
594
|
e && (te(e), Y.current = null, Z == null || Z());
|
|
@@ -596,7 +597,7 @@ function Xn(n, i) {
|
|
|
596
597
|
_.current = !0;
|
|
597
598
|
},
|
|
598
599
|
onExited: (e) => {
|
|
599
|
-
e && (me(!1), te(e), z == null || z(), _.current = !1, W && (
|
|
600
|
+
e && (me(!1), te(e), z == null || z(), _.current = !1, W && (M.current = null));
|
|
600
601
|
},
|
|
601
602
|
children: sn.cloneElement(
|
|
602
603
|
Ie(ie) ? ie(ve) : ve,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import d from "lodash/debounce";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { u as
|
|
4
|
-
const
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
o
|
|
2
|
+
import { useState as l, useDeferredValue as h, useCallback as o, useEffect as m } from "react";
|
|
3
|
+
import { u as z } from "./BL9DMeor.js";
|
|
4
|
+
const R = (s = !1) => {
|
|
5
|
+
const [i, u] = l({
|
|
6
|
+
...n(null)
|
|
7
|
+
}), c = h(
|
|
8
|
+
i
|
|
10
9
|
// 延迟一个值与防抖和节流之间有什么不同?
|
|
11
10
|
// 防抖 是指在用户停止输入一段时间(例如一秒钟)之后再更新列表。
|
|
12
11
|
// 节流 是指每隔一段时间(例如最多每秒一次)更新列表。
|
|
@@ -14,16 +13,21 @@ const p = (r = !1) => {
|
|
|
14
13
|
// 与防抖或节流不同,useDeferredValue 不需要选择任何固定延迟时间。如果用户的设备很快(比如性能强劲的笔记本电脑),延迟的重渲染几乎会立即发生并且不会被察觉。如果用户的设备较慢,那么列表会相应地“滞后”于输入,滞后的程度与设备的速度有关。
|
|
15
14
|
// 此外,与防抖或节流不同,useDeferredValue 执行的延迟重新渲染默认是可中断的。这意味着,如果 React 正在重新渲染一个大型列表,但用户进行了另一次键盘输入,React 会放弃该重新渲染,先处理键盘输入,然后再次开始在后台渲染。相比之下,防抖和节流仍会产生不顺畅的体验,因为它们是阻塞的:它们仅仅是将渲染阻塞键盘输入的时刻推迟了。
|
|
16
15
|
// 如果你要优化的工作不是在渲染期间发生的,那么防抖和节流仍然非常有用。例如,它们可以让你减少网络请求的次数。你也可以同时使用这些技术。
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
);
|
|
17
|
+
function n(e) {
|
|
18
|
+
const t = (e == null ? void 0 : e.currentTarget) ?? (e == null ? void 0 : e.target) ?? window;
|
|
19
|
+
return {
|
|
20
|
+
width: (t == null ? void 0 : t.innerWidth) ?? 0,
|
|
21
|
+
height: (t == null ? void 0 : t.innerHeight) ?? 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function r(e) {
|
|
25
|
+
u(n(e));
|
|
26
|
+
}
|
|
27
|
+
const a = o(r, []), f = o(d(r, 123), []);
|
|
28
|
+
return z(s ? f : a, []), m(() => () => {
|
|
29
|
+
}, []), c;
|
|
26
30
|
};
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
R as u
|
|
29
33
|
};
|
|
@@ -3,7 +3,7 @@ import Ke from "@unicom-cloud/icons/IconUiMenuFold";
|
|
|
3
3
|
import _e from "@unicom-cloud/icons/IconUiMenuUnfold";
|
|
4
4
|
import Re from "lodash/isPlainObject";
|
|
5
5
|
import F, { useContext as T, useState as fe, forwardRef as he, useEffect as te, useRef as ne, useMemo as Te } from "react";
|
|
6
|
-
import { a as ge } from "./
|
|
6
|
+
import { a as ge } from "./CNcLypMY.js";
|
|
7
7
|
import { u as Ae } from "./CQ_WOOmf.js";
|
|
8
8
|
import { u as oe } from "./B4YRLi8r.js";
|
|
9
9
|
import { u as Ue } from "./XTEsYGuF.js";
|